movehat 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/dist/commands/compile.d.ts +0 -1
- package/dist/commands/compile.js +0 -1
- package/dist/commands/fork/create.d.ts +1 -1
- package/dist/commands/fork/create.js +18 -3
- package/dist/commands/fork/fund.d.ts +0 -1
- package/dist/commands/fork/fund.js +0 -1
- package/dist/commands/fork/list.d.ts +0 -1
- package/dist/commands/fork/list.js +0 -1
- package/dist/commands/fork/serve.d.ts +0 -1
- package/dist/commands/fork/serve.js +0 -1
- package/dist/commands/fork/view-resource.d.ts +0 -1
- package/dist/commands/fork/view-resource.js +0 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +0 -1
- package/dist/commands/run.d.ts +17 -1
- package/dist/commands/run.js +46 -33
- package/dist/commands/test-move.d.ts +0 -1
- package/dist/commands/test-move.js +0 -1
- package/dist/commands/test.d.ts +0 -1
- package/dist/commands/test.js +8 -1
- package/dist/commands/update.d.ts +0 -1
- package/dist/commands/update.js +0 -1
- package/dist/core/AccountManager.d.ts +15 -2
- package/dist/core/AccountManager.js +32 -20
- package/dist/core/Publisher.d.ts +0 -1
- package/dist/core/Publisher.js +0 -1
- package/dist/core/config.d.ts +0 -1
- package/dist/core/config.js +109 -28
- package/dist/core/contract.d.ts +0 -1
- package/dist/core/contract.js +0 -1
- package/dist/core/deployments.d.ts +0 -1
- package/dist/core/deployments.js +0 -1
- package/dist/core/movementProfile.d.ts +0 -1
- package/dist/core/movementProfile.js +0 -1
- package/dist/core/shell.d.ts +0 -1
- package/dist/core/shell.js +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js +0 -1
- package/dist/fork/api.d.ts +24 -1
- package/dist/fork/api.js +95 -1
- package/dist/fork/manager.d.ts +14 -1
- package/dist/fork/manager.js +19 -1
- package/dist/fork/server.d.ts +19 -1
- package/dist/fork/server.js +188 -8
- package/dist/fork/storage.d.ts +0 -1
- package/dist/fork/storage.js +50 -32
- package/dist/fork/test.d.ts +0 -1
- package/dist/fork/test.js +0 -1
- package/dist/harness/Harness.d.ts +0 -1
- package/dist/harness/Harness.js +6 -2
- package/dist/harness/codeObject.d.ts +0 -1
- package/dist/harness/codeObject.js +0 -1
- package/dist/harness/errors.d.ts +0 -1
- package/dist/harness/errors.js +0 -1
- package/dist/harness/index.d.ts +0 -1
- package/dist/harness/index.js +0 -1
- package/dist/harness/proxy.d.ts +12 -1
- package/dist/harness/proxy.js +23 -1
- package/dist/harness/script.d.ts +0 -1
- package/dist/harness/script.js +0 -1
- package/dist/harness/view.d.ts +0 -1
- package/dist/harness/view.js +0 -1
- package/dist/helpers/assertions.d.ts +0 -1
- package/dist/helpers/assertions.js +0 -1
- package/dist/helpers/banner.d.ts +0 -1
- package/dist/helpers/banner.js +0 -1
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/move-tests.d.ts +0 -1
- package/dist/helpers/move-tests.js +0 -1
- package/dist/helpers/npm-registry.d.ts +0 -1
- package/dist/helpers/npm-registry.js +0 -1
- package/dist/helpers/semver-utils.d.ts +0 -1
- package/dist/helpers/semver-utils.js +0 -1
- package/dist/helpers/setup.d.ts +0 -1
- package/dist/helpers/setup.js +0 -1
- package/dist/helpers/setupLocalTesting.d.ts +2 -5
- package/dist/helpers/setupLocalTesting.js +0 -1
- package/dist/helpers/testFixtures.d.ts +0 -1
- package/dist/helpers/testFixtures.js +0 -1
- package/dist/helpers/version-check.d.ts +0 -1
- package/dist/helpers/version-check.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/node/LocalNodeManager.d.ts +0 -1
- package/dist/node/LocalNodeManager.js +4 -2
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +0 -1
- package/dist/types/config.d.ts +0 -1
- package/dist/types/config.js +0 -1
- package/dist/types/fork.d.ts +0 -1
- package/dist/types/fork.js +0 -1
- package/dist/types/harness.d.ts +0 -1
- package/dist/types/harness.js +0 -1
- package/dist/types/runtime.d.ts +0 -1
- package/dist/types/runtime.js +0 -1
- package/dist/ui/colors.d.ts +0 -1
- package/dist/ui/colors.js +0 -1
- package/dist/ui/formatters.d.ts +0 -1
- package/dist/ui/formatters.js +0 -1
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/logger.d.ts +0 -1
- package/dist/ui/logger.js +0 -1
- package/dist/ui/spinner.d.ts +0 -1
- package/dist/ui/spinner.js +0 -1
- package/dist/ui/symbols.d.ts +0 -1
- package/dist/ui/symbols.js +0 -1
- package/dist/ui/table.d.ts +0 -1
- package/dist/ui/table.js +0 -1
- package/dist/utils/address.d.ts +0 -1
- package/dist/utils/address.js +0 -1
- package/dist/utils/childProcessAdapter.d.ts +0 -1
- package/dist/utils/childProcessAdapter.js +46 -20
- package/dist/utils/movementCli.d.ts +5 -0
- package/dist/utils/movementCli.js +91 -0
- package/dist/utils/parseCliOutput.d.ts +6 -4
- package/dist/utils/parseCliOutput.js +10 -6
- package/dist/utils/redact.d.ts +3 -3
- package/dist/utils/redact.js +6 -5
- package/dist/utils/runCli.d.ts +0 -1
- package/dist/utils/runCli.js +10 -2
- package/package.json +4 -4
- package/dist/__tests__/deployContract.test.d.ts +0 -2
- package/dist/__tests__/deployContract.test.d.ts.map +0 -1
- package/dist/__tests__/deployContract.test.js +0 -377
- package/dist/__tests__/deployContract.test.js.map +0 -1
- package/dist/__tests__/errors.test.d.ts +0 -2
- package/dist/__tests__/errors.test.d.ts.map +0 -1
- package/dist/__tests__/errors.test.js +0 -46
- package/dist/__tests__/errors.test.js.map +0 -1
- package/dist/__tests__/exports.test.d.ts +0 -2
- package/dist/__tests__/exports.test.d.ts.map +0 -1
- package/dist/__tests__/exports.test.js +0 -30
- package/dist/__tests__/exports.test.js.map +0 -1
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts +0 -25
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts.map +0 -1
- package/dist/__tests__/fixtures/sigint-deploy-harness.js +0 -83
- package/dist/__tests__/fixtures/sigint-deploy-harness.js.map +0 -1
- package/dist/__tests__/fork/api.test.d.ts +0 -2
- package/dist/__tests__/fork/api.test.d.ts.map +0 -1
- package/dist/__tests__/fork/api.test.js +0 -115
- package/dist/__tests__/fork/api.test.js.map +0 -1
- package/dist/__tests__/fork/api.timeout.test.d.ts +0 -2
- package/dist/__tests__/fork/api.timeout.test.d.ts.map +0 -1
- package/dist/__tests__/fork/api.timeout.test.js +0 -98
- package/dist/__tests__/fork/api.timeout.test.js.map +0 -1
- package/dist/__tests__/harness/Harness.createLive.test.d.ts +0 -2
- package/dist/__tests__/harness/Harness.createLive.test.d.ts.map +0 -1
- package/dist/__tests__/harness/Harness.createLive.test.js +0 -53
- package/dist/__tests__/harness/Harness.createLive.test.js.map +0 -1
- package/dist/__tests__/harness/Harness.proxy.test.d.ts +0 -2
- package/dist/__tests__/harness/Harness.proxy.test.d.ts.map +0 -1
- package/dist/__tests__/harness/Harness.proxy.test.js +0 -89
- package/dist/__tests__/harness/Harness.proxy.test.js.map +0 -1
- package/dist/__tests__/harness/_fixture.d.ts +0 -54
- package/dist/__tests__/harness/_fixture.d.ts.map +0 -1
- package/dist/__tests__/harness/_fixture.js +0 -69
- package/dist/__tests__/harness/_fixture.js.map +0 -1
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts +0 -2
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts.map +0 -1
- package/dist/__tests__/harness/codeObject.deploy.test.js +0 -288
- package/dist/__tests__/harness/codeObject.deploy.test.js.map +0 -1
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts +0 -2
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts.map +0 -1
- package/dist/__tests__/harness/codeObject.upgrade.test.js +0 -138
- package/dist/__tests__/harness/codeObject.upgrade.test.js.map +0 -1
- package/dist/__tests__/harness/script.test.d.ts +0 -2
- package/dist/__tests__/harness/script.test.d.ts.map +0 -1
- package/dist/__tests__/harness/script.test.js +0 -219
- package/dist/__tests__/harness/script.test.js.map +0 -1
- package/dist/__tests__/harness/view.test.d.ts +0 -2
- package/dist/__tests__/harness/view.test.d.ts.map +0 -1
- package/dist/__tests__/harness/view.test.js +0 -92
- package/dist/__tests__/harness/view.test.js.map +0 -1
- package/dist/__tests__/runtime.test.d.ts +0 -2
- package/dist/__tests__/runtime.test.d.ts.map +0 -1
- package/dist/__tests__/runtime.test.js +0 -141
- package/dist/__tests__/runtime.test.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/__tests__/compile.test.d.ts +0 -2
- package/dist/commands/__tests__/compile.test.d.ts.map +0 -1
- package/dist/commands/__tests__/compile.test.js +0 -351
- package/dist/commands/__tests__/compile.test.js.map +0 -1
- package/dist/commands/__tests__/compile.toml-mutation.test.d.ts +0 -2
- package/dist/commands/__tests__/compile.toml-mutation.test.d.ts.map +0 -1
- package/dist/commands/__tests__/compile.toml-mutation.test.js +0 -69
- package/dist/commands/__tests__/compile.toml-mutation.test.js.map +0 -1
- package/dist/commands/__tests__/init.test.d.ts +0 -2
- package/dist/commands/__tests__/init.test.d.ts.map +0 -1
- package/dist/commands/__tests__/init.test.js +0 -163
- package/dist/commands/__tests__/init.test.js.map +0 -1
- package/dist/commands/__tests__/run.test.d.ts +0 -2
- package/dist/commands/__tests__/run.test.d.ts.map +0 -1
- package/dist/commands/__tests__/run.test.js +0 -166
- package/dist/commands/__tests__/run.test.js.map +0 -1
- package/dist/commands/__tests__/test-move.test.d.ts +0 -2
- package/dist/commands/__tests__/test-move.test.d.ts.map +0 -1
- package/dist/commands/__tests__/test-move.test.js +0 -59
- package/dist/commands/__tests__/test-move.test.js.map +0 -1
- package/dist/commands/__tests__/test.test.d.ts +0 -2
- package/dist/commands/__tests__/test.test.d.ts.map +0 -1
- package/dist/commands/__tests__/test.test.js +0 -168
- package/dist/commands/__tests__/test.test.js.map +0 -1
- package/dist/commands/__tests__/update.test.d.ts +0 -2
- package/dist/commands/__tests__/update.test.d.ts.map +0 -1
- package/dist/commands/__tests__/update.test.js +0 -176
- package/dist/commands/__tests__/update.test.js.map +0 -1
- package/dist/commands/compile.d.ts.map +0 -1
- package/dist/commands/compile.js.map +0 -1
- package/dist/commands/fork/__tests__/create.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/create.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/create.test.js +0 -108
- package/dist/commands/fork/__tests__/create.test.js.map +0 -1
- package/dist/commands/fork/__tests__/fund.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/fund.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/fund.test.js +0 -72
- package/dist/commands/fork/__tests__/fund.test.js.map +0 -1
- package/dist/commands/fork/__tests__/list.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/list.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/list.test.js +0 -119
- package/dist/commands/fork/__tests__/list.test.js.map +0 -1
- package/dist/commands/fork/__tests__/serve.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/serve.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/serve.test.js +0 -97
- package/dist/commands/fork/__tests__/serve.test.js.map +0 -1
- package/dist/commands/fork/__tests__/view-resource.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/view-resource.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/view-resource.test.js +0 -77
- package/dist/commands/fork/__tests__/view-resource.test.js.map +0 -1
- package/dist/commands/fork/create.d.ts.map +0 -1
- package/dist/commands/fork/create.js.map +0 -1
- package/dist/commands/fork/fund.d.ts.map +0 -1
- package/dist/commands/fork/fund.js.map +0 -1
- package/dist/commands/fork/list.d.ts.map +0 -1
- package/dist/commands/fork/list.js.map +0 -1
- package/dist/commands/fork/serve.d.ts.map +0 -1
- package/dist/commands/fork/serve.js.map +0 -1
- package/dist/commands/fork/view-resource.d.ts.map +0 -1
- package/dist/commands/fork/view-resource.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/test-move.d.ts.map +0 -1
- package/dist/commands/test-move.js.map +0 -1
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js.map +0 -1
- package/dist/core/AccountManager.d.ts.map +0 -1
- package/dist/core/AccountManager.js.map +0 -1
- package/dist/core/Publisher.d.ts.map +0 -1
- package/dist/core/Publisher.js.map +0 -1
- package/dist/core/__tests__/AccountManager.global-state.test.d.ts +0 -2
- package/dist/core/__tests__/AccountManager.global-state.test.d.ts.map +0 -1
- package/dist/core/__tests__/AccountManager.global-state.test.js +0 -69
- package/dist/core/__tests__/AccountManager.global-state.test.js.map +0 -1
- package/dist/core/__tests__/AccountManager.test.d.ts +0 -2
- package/dist/core/__tests__/AccountManager.test.d.ts.map +0 -1
- package/dist/core/__tests__/AccountManager.test.js +0 -239
- package/dist/core/__tests__/AccountManager.test.js.map +0 -1
- package/dist/core/__tests__/config.test.d.ts +0 -2
- package/dist/core/__tests__/config.test.d.ts.map +0 -1
- package/dist/core/__tests__/config.test.js +0 -311
- package/dist/core/__tests__/config.test.js.map +0 -1
- package/dist/core/__tests__/deployments.test.d.ts +0 -2
- package/dist/core/__tests__/deployments.test.d.ts.map +0 -1
- package/dist/core/__tests__/deployments.test.js +0 -201
- package/dist/core/__tests__/deployments.test.js.map +0 -1
- package/dist/core/__tests__/movementProfile.test.d.ts +0 -2
- package/dist/core/__tests__/movementProfile.test.d.ts.map +0 -1
- package/dist/core/__tests__/movementProfile.test.js +0 -112
- package/dist/core/__tests__/movementProfile.test.js.map +0 -1
- package/dist/core/__tests__/shell.test.d.ts +0 -2
- package/dist/core/__tests__/shell.test.d.ts.map +0 -1
- package/dist/core/__tests__/shell.test.js +0 -107
- package/dist/core/__tests__/shell.test.js.map +0 -1
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js.map +0 -1
- package/dist/core/contract.d.ts.map +0 -1
- package/dist/core/contract.js.map +0 -1
- package/dist/core/deployments.d.ts.map +0 -1
- package/dist/core/deployments.js.map +0 -1
- package/dist/core/movementProfile.d.ts.map +0 -1
- package/dist/core/movementProfile.js.map +0 -1
- package/dist/core/shell.d.ts.map +0 -1
- package/dist/core/shell.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/fork/__tests__/manager.test.d.ts +0 -2
- package/dist/fork/__tests__/manager.test.d.ts.map +0 -1
- package/dist/fork/__tests__/manager.test.js +0 -309
- package/dist/fork/__tests__/manager.test.js.map +0 -1
- package/dist/fork/__tests__/server.cors.test.d.ts +0 -2
- package/dist/fork/__tests__/server.cors.test.d.ts.map +0 -1
- package/dist/fork/__tests__/server.cors.test.js +0 -79
- package/dist/fork/__tests__/server.cors.test.js.map +0 -1
- package/dist/fork/__tests__/server.test.d.ts +0 -2
- package/dist/fork/__tests__/server.test.d.ts.map +0 -1
- package/dist/fork/__tests__/server.test.js +0 -54
- package/dist/fork/__tests__/server.test.js.map +0 -1
- package/dist/fork/__tests__/storage.test.d.ts +0 -2
- package/dist/fork/__tests__/storage.test.d.ts.map +0 -1
- package/dist/fork/__tests__/storage.test.js +0 -222
- package/dist/fork/__tests__/storage.test.js.map +0 -1
- package/dist/fork/__tests__/test.test.d.ts +0 -2
- package/dist/fork/__tests__/test.test.d.ts.map +0 -1
- package/dist/fork/__tests__/test.test.js +0 -81
- package/dist/fork/__tests__/test.test.js.map +0 -1
- package/dist/fork/api.d.ts.map +0 -1
- package/dist/fork/api.js.map +0 -1
- package/dist/fork/manager.d.ts.map +0 -1
- package/dist/fork/manager.js.map +0 -1
- package/dist/fork/server.d.ts.map +0 -1
- package/dist/fork/server.js.map +0 -1
- package/dist/fork/storage.d.ts.map +0 -1
- package/dist/fork/storage.js.map +0 -1
- package/dist/fork/test.d.ts.map +0 -1
- package/dist/fork/test.js.map +0 -1
- package/dist/harness/Harness.d.ts.map +0 -1
- package/dist/harness/Harness.js.map +0 -1
- package/dist/harness/codeObject.d.ts.map +0 -1
- package/dist/harness/codeObject.js.map +0 -1
- package/dist/harness/errors.d.ts.map +0 -1
- package/dist/harness/errors.js.map +0 -1
- package/dist/harness/index.d.ts.map +0 -1
- package/dist/harness/index.js.map +0 -1
- package/dist/harness/proxy.d.ts.map +0 -1
- package/dist/harness/proxy.js.map +0 -1
- package/dist/harness/script.d.ts.map +0 -1
- package/dist/harness/script.js.map +0 -1
- package/dist/harness/view.d.ts.map +0 -1
- package/dist/harness/view.js.map +0 -1
- package/dist/helpers/__tests__/semver-utils.test.d.ts +0 -2
- package/dist/helpers/__tests__/semver-utils.test.d.ts.map +0 -1
- package/dist/helpers/__tests__/semver-utils.test.js +0 -103
- package/dist/helpers/__tests__/semver-utils.test.js.map +0 -1
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.d.ts +0 -2
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.d.ts.map +0 -1
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.js +0 -172
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.js.map +0 -1
- package/dist/helpers/assertions.d.ts.map +0 -1
- package/dist/helpers/assertions.js.map +0 -1
- package/dist/helpers/banner.d.ts.map +0 -1
- package/dist/helpers/banner.js.map +0 -1
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/index.js.map +0 -1
- package/dist/helpers/move-tests.d.ts.map +0 -1
- package/dist/helpers/move-tests.js.map +0 -1
- package/dist/helpers/npm-registry.d.ts.map +0 -1
- package/dist/helpers/npm-registry.js.map +0 -1
- package/dist/helpers/semver-utils.d.ts.map +0 -1
- package/dist/helpers/semver-utils.js.map +0 -1
- package/dist/helpers/setup.d.ts.map +0 -1
- package/dist/helpers/setup.js.map +0 -1
- package/dist/helpers/setupLocalTesting.d.ts.map +0 -1
- package/dist/helpers/setupLocalTesting.js.map +0 -1
- package/dist/helpers/testFixtures.d.ts.map +0 -1
- package/dist/helpers/testFixtures.js.map +0 -1
- package/dist/helpers/version-check.d.ts.map +0 -1
- package/dist/helpers/version-check.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node/LocalNodeManager.d.ts.map +0 -1
- package/dist/node/LocalNodeManager.js.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.api-port.test.d.ts +0 -2
- package/dist/node/__tests__/LocalNodeManager.api-port.test.d.ts.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.api-port.test.js +0 -55
- package/dist/node/__tests__/LocalNodeManager.api-port.test.js.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.test.d.ts +0 -2
- package/dist/node/__tests__/LocalNodeManager.test.d.ts.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.test.js +0 -449
- package/dist/node/__tests__/LocalNodeManager.test.js.map +0 -1
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js.map +0 -1
- package/dist/types/fork.d.ts.map +0 -1
- package/dist/types/fork.js.map +0 -1
- package/dist/types/harness.d.ts.map +0 -1
- package/dist/types/harness.js.map +0 -1
- package/dist/types/runtime.d.ts.map +0 -1
- package/dist/types/runtime.js.map +0 -1
- package/dist/ui/__tests__/colors.test.d.ts +0 -2
- package/dist/ui/__tests__/colors.test.d.ts.map +0 -1
- package/dist/ui/__tests__/colors.test.js +0 -127
- package/dist/ui/__tests__/colors.test.js.map +0 -1
- package/dist/ui/__tests__/logger.test.d.ts +0 -2
- package/dist/ui/__tests__/logger.test.d.ts.map +0 -1
- package/dist/ui/__tests__/logger.test.js +0 -75
- package/dist/ui/__tests__/logger.test.js.map +0 -1
- package/dist/ui/colors.d.ts.map +0 -1
- package/dist/ui/colors.js.map +0 -1
- package/dist/ui/formatters.d.ts.map +0 -1
- package/dist/ui/formatters.js.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/logger.d.ts.map +0 -1
- package/dist/ui/logger.js.map +0 -1
- package/dist/ui/spinner.d.ts.map +0 -1
- package/dist/ui/spinner.js.map +0 -1
- package/dist/ui/symbols.d.ts.map +0 -1
- package/dist/ui/symbols.js.map +0 -1
- package/dist/ui/table.d.ts.map +0 -1
- package/dist/ui/table.js.map +0 -1
- package/dist/utils/__tests__/address.test.d.ts +0 -2
- package/dist/utils/__tests__/address.test.d.ts.map +0 -1
- package/dist/utils/__tests__/address.test.js +0 -70
- package/dist/utils/__tests__/address.test.js.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.d.ts +0 -2
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.d.ts.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.js +0 -43
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.js.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts +0 -2
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.test.js +0 -217
- package/dist/utils/__tests__/childProcessAdapter.test.js.map +0 -1
- package/dist/utils/__tests__/runCli.test.d.ts +0 -2
- package/dist/utils/__tests__/runCli.test.d.ts.map +0 -1
- package/dist/utils/__tests__/runCli.test.js +0 -187
- package/dist/utils/__tests__/runCli.test.js.map +0 -1
- package/dist/utils/address.d.ts.map +0 -1
- package/dist/utils/address.js.map +0 -1
- package/dist/utils/childProcessAdapter.d.ts.map +0 -1
- package/dist/utils/childProcessAdapter.js.map +0 -1
- package/dist/utils/parseCliOutput.d.ts.map +0 -1
- package/dist/utils/parseCliOutput.js.map +0 -1
- package/dist/utils/redact.d.ts.map +0 -1
- package/dist/utils/redact.js.map +0 -1
- package/dist/utils/runCli.d.ts.map +0 -1
- package/dist/utils/runCli.js.map +0 -1
- package/src/__tests__/deployContract.test.ts +0 -438
- package/src/__tests__/errors.test.ts +0 -84
- package/src/__tests__/exports.test.ts +0 -32
- package/src/__tests__/fixtures/sigint-deploy-harness.ts +0 -96
- package/src/__tests__/fork/api.test.ts +0 -148
- package/src/__tests__/fork/api.timeout.test.ts +0 -150
- package/src/__tests__/harness/Harness.createLive.test.ts +0 -57
- package/src/__tests__/harness/Harness.proxy.test.ts +0 -111
- package/src/__tests__/harness/_fixture.ts +0 -131
- package/src/__tests__/harness/codeObject.deploy.test.ts +0 -319
- package/src/__tests__/harness/codeObject.upgrade.test.ts +0 -156
- package/src/__tests__/harness/script.test.ts +0 -245
- package/src/__tests__/harness/view.test.ts +0 -104
- package/src/__tests__/runtime.test.ts +0 -182
- package/src/cli.ts +0 -164
- package/src/commands/__tests__/compile.test.ts +0 -407
- package/src/commands/__tests__/compile.toml-mutation.test.ts +0 -77
- package/src/commands/__tests__/init.test.ts +0 -210
- package/src/commands/__tests__/run.test.ts +0 -192
- package/src/commands/__tests__/test-move.test.ts +0 -81
- package/src/commands/__tests__/test.test.ts +0 -204
- package/src/commands/__tests__/update.test.ts +0 -223
- package/src/commands/compile.ts +0 -339
- package/src/commands/fork/__tests__/create.test.ts +0 -132
- package/src/commands/fork/__tests__/fund.test.ts +0 -104
- package/src/commands/fork/__tests__/list.test.ts +0 -139
- package/src/commands/fork/__tests__/serve.test.ts +0 -121
- package/src/commands/fork/__tests__/view-resource.test.ts +0 -101
- package/src/commands/fork/create.ts +0 -110
- package/src/commands/fork/fund.ts +0 -64
- package/src/commands/fork/list.ts +0 -98
- package/src/commands/fork/serve.ts +0 -80
- package/src/commands/fork/view-resource.ts +0 -51
- package/src/commands/init.ts +0 -264
- package/src/commands/run.ts +0 -125
- package/src/commands/test-move.ts +0 -27
- package/src/commands/test.ts +0 -255
- package/src/commands/update.ts +0 -201
- package/src/core/AccountManager.ts +0 -457
- package/src/core/Publisher.ts +0 -310
- package/src/core/__tests__/AccountManager.global-state.test.ts +0 -83
- package/src/core/__tests__/AccountManager.test.ts +0 -290
- package/src/core/__tests__/config.test.ts +0 -377
- package/src/core/__tests__/deployments.test.ts +0 -247
- package/src/core/__tests__/movementProfile.test.ts +0 -131
- package/src/core/__tests__/shell.test.ts +0 -138
- package/src/core/config.ts +0 -286
- package/src/core/contract.ts +0 -103
- package/src/core/deployments.ts +0 -155
- package/src/core/movementProfile.ts +0 -127
- package/src/core/shell.ts +0 -86
- package/src/errors.ts +0 -81
- package/src/fork/__tests__/manager.test.ts +0 -385
- package/src/fork/__tests__/server.cors.test.ts +0 -101
- package/src/fork/__tests__/server.test.ts +0 -65
- package/src/fork/__tests__/storage.test.ts +0 -281
- package/src/fork/__tests__/test.test.ts +0 -97
- package/src/fork/api.ts +0 -190
- package/src/fork/manager.ts +0 -343
- package/src/fork/server.ts +0 -380
- package/src/fork/storage.ts +0 -253
- package/src/fork/test.ts +0 -221
- package/src/harness/Harness.ts +0 -231
- package/src/harness/codeObject.ts +0 -381
- package/src/harness/errors.ts +0 -22
- package/src/harness/index.ts +0 -3
- package/src/harness/proxy.ts +0 -40
- package/src/harness/script.ts +0 -200
- package/src/harness/view.ts +0 -34
- package/src/helpers/__tests__/semver-utils.test.ts +0 -121
- package/src/helpers/__tests__/setupLocalTesting.fork-network.test.ts +0 -212
- package/src/helpers/assertions.ts +0 -29
- package/src/helpers/banner.ts +0 -63
- package/src/helpers/index.ts +0 -37
- package/src/helpers/move-tests.ts +0 -72
- package/src/helpers/npm-registry.ts +0 -72
- package/src/helpers/semver-utils.ts +0 -54
- package/src/helpers/setup.ts +0 -54
- package/src/helpers/setupLocalTesting.ts +0 -387
- package/src/helpers/testFixtures.ts +0 -210
- package/src/helpers/version-check.ts +0 -114
- package/src/index.ts +0 -30
- package/src/node/LocalNodeManager.ts +0 -383
- package/src/node/__tests__/LocalNodeManager.api-port.test.ts +0 -62
- package/src/node/__tests__/LocalNodeManager.test.ts +0 -579
- package/src/runtime.ts +0 -157
- package/src/templates/.env.example +0 -9
- package/src/templates/.mocharc.json +0 -8
- package/src/templates/.vscode/settings.json +0 -11
- package/src/templates/README.md +0 -146
- package/src/templates/gitignore +0 -22
- package/src/templates/move/Move.toml +0 -19
- package/src/templates/move/sources/Counter.move +0 -96
- package/src/templates/movehat.config.ts +0 -57
- package/src/templates/package.json +0 -27
- package/src/templates/scripts/deploy-counter.ts +0 -66
- package/src/templates/tests/Counter.test.ts +0 -113
- package/src/templates/tsconfig.json +0 -15
- package/src/templates/types/movehat.d.ts +0 -101
- package/src/types/config.ts +0 -83
- package/src/types/fork.ts +0 -47
- package/src/types/harness.ts +0 -182
- package/src/types/runtime.ts +0 -57
- package/src/ui/__tests__/colors.test.ts +0 -156
- package/src/ui/__tests__/logger.test.ts +0 -89
- package/src/ui/colors.ts +0 -144
- package/src/ui/formatters.ts +0 -246
- package/src/ui/index.ts +0 -62
- package/src/ui/logger.ts +0 -310
- package/src/ui/spinner.ts +0 -218
- package/src/ui/symbols.ts +0 -80
- package/src/ui/table.ts +0 -191
- package/src/utils/__tests__/address.test.ts +0 -93
- package/src/utils/__tests__/childProcessAdapter.maxBuffer.test.ts +0 -51
- package/src/utils/__tests__/childProcessAdapter.test.ts +0 -266
- package/src/utils/__tests__/runCli.test.ts +0 -240
- package/src/utils/address.ts +0 -52
- package/src/utils/childProcessAdapter.ts +0 -244
- package/src/utils/parseCliOutput.ts +0 -27
- package/src/utils/redact.ts +0 -24
- package/src/utils/runCli.ts +0 -64
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
existsSync,
|
|
4
|
-
mkdirSync,
|
|
5
|
-
mkdtempSync,
|
|
6
|
-
readFileSync,
|
|
7
|
-
rmSync,
|
|
8
|
-
writeFileSync,
|
|
9
|
-
} from "node:fs";
|
|
10
|
-
import { tmpdir } from "node:os";
|
|
11
|
-
import { dirname, join } from "node:path";
|
|
12
|
-
import { fileURLToPath } from "node:url";
|
|
13
|
-
import { createRequire } from "node:module";
|
|
14
|
-
import { spawn } from "node:child_process";
|
|
15
|
-
import * as yaml from "js-yaml";
|
|
16
|
-
import { CliExecutionError } from "../errors.js";
|
|
17
|
-
import { initRuntime } from "../runtime.js";
|
|
18
|
-
import { Publisher } from "../core/Publisher.js";
|
|
19
|
-
import type { ChildProcessAdapter, RunInput, RunResult } from "../utils/childProcessAdapter.js";
|
|
20
|
-
|
|
21
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
22
|
-
const require = createRequire(import.meta.url);
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Guards against the bug-#43 leak path: when `movement move publish`
|
|
26
|
-
* echoes `ed25519-priv-…` material in stdout/stderr, neither the
|
|
27
|
-
* thrown error nor anything reaching `console.error` may carry the
|
|
28
|
-
* raw key. The redaction is structurally guaranteed by runCli today
|
|
29
|
-
* — these tests make the guarantee *directly* asserted so a future
|
|
30
|
-
* PR adding a non-runCli code path can't silently re-leak.
|
|
31
|
-
*/
|
|
32
|
-
describe("runtime.deployContract — secret redaction", () => {
|
|
33
|
-
let tmpHome: string;
|
|
34
|
-
let tmpCwd: string;
|
|
35
|
-
let origHome: string | undefined;
|
|
36
|
-
let origCwd: string;
|
|
37
|
-
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
tmpHome = mkdtempSync(join(tmpdir(), "movehat-test-home-"));
|
|
40
|
-
tmpCwd = mkdtempSync(join(tmpdir(), "movehat-test-cwd-"));
|
|
41
|
-
|
|
42
|
-
// Minimal movehat.config.js — testnet with no `accounts` means the
|
|
43
|
-
// auto-generated deterministic test key is used (config.ts:147-155).
|
|
44
|
-
writeFileSync(
|
|
45
|
-
join(tmpCwd, "movehat.config.js"),
|
|
46
|
-
`export default {
|
|
47
|
-
defaultNetwork: "testnet",
|
|
48
|
-
networks: {
|
|
49
|
-
testnet: {
|
|
50
|
-
url: "https://testnet.movementnetwork.xyz/v1",
|
|
51
|
-
chainId: "testnet"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
`
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
// Minimal Move package layout. `extractNamedAddresses` reads
|
|
59
|
-
// <moveDir>/sources/*.move; the empty file produces an empty Set.
|
|
60
|
-
const moveDir = join(tmpCwd, "move");
|
|
61
|
-
mkdirSync(join(moveDir, "sources"), { recursive: true });
|
|
62
|
-
writeFileSync(
|
|
63
|
-
join(moveDir, "Move.toml"),
|
|
64
|
-
`[package]
|
|
65
|
-
name = "dummy"
|
|
66
|
-
version = "0.0.1"
|
|
67
|
-
|
|
68
|
-
[addresses]
|
|
69
|
-
`
|
|
70
|
-
);
|
|
71
|
-
writeFileSync(join(moveDir, "sources", "dummy.move"), "// intentionally empty\n");
|
|
72
|
-
|
|
73
|
-
origHome = process.env.HOME;
|
|
74
|
-
process.env.HOME = tmpHome;
|
|
75
|
-
origCwd = process.cwd();
|
|
76
|
-
process.chdir(tmpCwd);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
afterEach(() => {
|
|
80
|
-
try {
|
|
81
|
-
process.chdir(origCwd);
|
|
82
|
-
} finally {
|
|
83
|
-
if (origHome === undefined) delete process.env.HOME;
|
|
84
|
-
else process.env.HOME = origHome;
|
|
85
|
-
if (existsSync(tmpHome)) rmSync(tmpHome, { recursive: true, force: true });
|
|
86
|
-
if (existsSync(tmpCwd)) rmSync(tmpCwd, { recursive: true, force: true });
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
function makeAdapter(steps: { build: RunResult; publish: RunResult }): {
|
|
91
|
-
adapter: ChildProcessAdapter;
|
|
92
|
-
calls: RunInput[];
|
|
93
|
-
} {
|
|
94
|
-
const calls: RunInput[] = [];
|
|
95
|
-
const adapter: ChildProcessAdapter = {
|
|
96
|
-
async run(input) {
|
|
97
|
-
calls.push(input);
|
|
98
|
-
// The args layout is `["move", "build" | "publish", ...rest]`.
|
|
99
|
-
if (input.args[1] === "build") return steps.build;
|
|
100
|
-
if (input.args[1] === "publish") return steps.publish;
|
|
101
|
-
throw new Error(`unexpected movement subcommand: ${input.args[1]}`);
|
|
102
|
-
},
|
|
103
|
-
spawn() {
|
|
104
|
-
throw new Error("spawn not used in deployContract tests");
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
return { adapter, calls };
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
it("leak path #2 — rethrown error has redacted stderr (no raw ed25519-priv-)", async () => {
|
|
111
|
-
const rawKey = "ed25519-priv-0x" + "a".repeat(64);
|
|
112
|
-
const { adapter, calls } = makeAdapter({
|
|
113
|
-
build: { exitCode: 0, stdout: "build ok", stderr: "" },
|
|
114
|
-
publish: { exitCode: 1, stdout: "", stderr: `Movement publish failed: ${rawKey}` },
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
const runtime = await initRuntime();
|
|
118
|
-
|
|
119
|
-
let captured: unknown;
|
|
120
|
-
try {
|
|
121
|
-
await runtime.deployContract("mymodule", { adapter });
|
|
122
|
-
} catch (err) {
|
|
123
|
-
captured = err;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
expect(captured).toBeInstanceOf(CliExecutionError);
|
|
127
|
-
const err = captured as CliExecutionError;
|
|
128
|
-
expect(err.stderr).toContain("***REDACTED***");
|
|
129
|
-
expect(err.stderr).not.toContain("ed25519-priv-");
|
|
130
|
-
expect(err.stderr).not.toContain(rawKey);
|
|
131
|
-
|
|
132
|
-
// Pin the call shape: build then publish, args reach the adapter un-quoted.
|
|
133
|
-
// A previous regression (shell-escape mismatch fixed in 511fd95) survived
|
|
134
|
-
// unit tests because no assertion checked what landed in `args`.
|
|
135
|
-
expect(calls).toHaveLength(2);
|
|
136
|
-
const [build, publish] = calls;
|
|
137
|
-
if (!build || !publish) throw new Error("expected 2 captured calls");
|
|
138
|
-
expect(build.command).toBe("movement");
|
|
139
|
-
expect(build.args.slice(0, 2)).toEqual(["move", "build"]);
|
|
140
|
-
expect(publish.args.slice(0, 2)).toEqual(["move", "publish"]);
|
|
141
|
-
for (const arg of [...build.args, ...publish.args]) {
|
|
142
|
-
expect(arg.startsWith("'")).toBe(false);
|
|
143
|
-
expect(arg.endsWith("'")).toBe(false);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Bonus: deployContract's finally block must have restored / removed the
|
|
147
|
-
// movement config file. If a future refactor breaks the finally, this
|
|
148
|
-
// assertion fires before any real damage.
|
|
149
|
-
expect(existsSync(join(tmpHome, ".aptos", "config.yaml"))).toBe(false);
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it("two concurrent deploys use distinct temp key files and never touch ~/.aptos/config.yaml", async () => {
|
|
153
|
-
// Each deploy writes its private key to a UUID-named temp file
|
|
154
|
-
// (see `core/movementProfile.ts:writeTempKeyFile`) and passes
|
|
155
|
-
// `--private-key-file <path>` to Movement CLI. Concurrent deploys
|
|
156
|
-
// have no shared state — no profile YAML, no mutex, no race.
|
|
157
|
-
// Asserts:
|
|
158
|
-
// 1. Each invocation records a DISTINCT --private-key-file path.
|
|
159
|
-
// 2. After both deploys finish, neither temp key file remains on
|
|
160
|
-
// disk (cleanup ran on both happy paths).
|
|
161
|
-
// 3. ~/.aptos/config.yaml is byte-identical to what was on disk
|
|
162
|
-
// before — the new flow doesn't touch the user's CLI config.
|
|
163
|
-
|
|
164
|
-
// Seed an unrelated user profile that MUST survive untouched.
|
|
165
|
-
const aptosDir = join(tmpHome, ".aptos");
|
|
166
|
-
mkdirSync(aptosDir, { recursive: true });
|
|
167
|
-
const preExisting = {
|
|
168
|
-
profiles: {
|
|
169
|
-
user_main: {
|
|
170
|
-
private_key: "0x" + "1".repeat(64),
|
|
171
|
-
public_key: "0x" + "2".repeat(64),
|
|
172
|
-
account: "0x" + "3".repeat(64),
|
|
173
|
-
rest_url: "https://example.invalid/v1",
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
const configPath = join(aptosDir, "config.yaml");
|
|
178
|
-
writeFileSync(configPath, yaml.dump(preExisting), { mode: 0o600 });
|
|
179
|
-
const initialConfigBytes = readFileSync(configPath, "utf8");
|
|
180
|
-
|
|
181
|
-
// Set up two Publisher instances with fake adapters that record
|
|
182
|
-
// their --private-key-file argument and inject a small delay on
|
|
183
|
-
// publish so the critical sections overlap.
|
|
184
|
-
function makeDelayedAdapter(label: string): {
|
|
185
|
-
adapter: ChildProcessAdapter;
|
|
186
|
-
captured: { publishCall?: RunInput };
|
|
187
|
-
} {
|
|
188
|
-
const captured: { publishCall?: RunInput } = {};
|
|
189
|
-
const adapter: ChildProcessAdapter = {
|
|
190
|
-
async run(input) {
|
|
191
|
-
if (input.args[1] === "build") {
|
|
192
|
-
return { exitCode: 0, stdout: `built ${label}`, stderr: "" };
|
|
193
|
-
}
|
|
194
|
-
if (input.args[1] === "publish") {
|
|
195
|
-
captured.publishCall = input;
|
|
196
|
-
// Hold the lock-protected critical section open long enough
|
|
197
|
-
// for the other deploy's addProfile to compete.
|
|
198
|
-
await new Promise((r) => setTimeout(r, 30));
|
|
199
|
-
return {
|
|
200
|
-
exitCode: 0,
|
|
201
|
-
stdout: `Transaction hash: 0x${"d".repeat(64)}`,
|
|
202
|
-
stderr: "",
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
throw new Error(`unexpected: ${input.args[1]}`);
|
|
206
|
-
},
|
|
207
|
-
spawn() {
|
|
208
|
-
throw new Error("spawn not used");
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
|
-
return { adapter, captured };
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
const a = makeDelayedAdapter("A");
|
|
215
|
-
const b = makeDelayedAdapter("B");
|
|
216
|
-
|
|
217
|
-
// Build a minimal config + account once via initRuntime, then call
|
|
218
|
-
// Publisher directly (bypasses the loadDeployment cache that would
|
|
219
|
-
// throw on the second deploy if both used moduleName "test").
|
|
220
|
-
const runtime = await initRuntime();
|
|
221
|
-
const { config, account } = runtime;
|
|
222
|
-
|
|
223
|
-
await Promise.all([
|
|
224
|
-
new Publisher({ adapter: a.adapter }).deploy({
|
|
225
|
-
moduleName: "concurrent_a",
|
|
226
|
-
config,
|
|
227
|
-
account,
|
|
228
|
-
packageDir: join(tmpCwd, "move"),
|
|
229
|
-
}),
|
|
230
|
-
new Publisher({ adapter: b.adapter }).deploy({
|
|
231
|
-
moduleName: "concurrent_b",
|
|
232
|
-
config,
|
|
233
|
-
account,
|
|
234
|
-
packageDir: join(tmpCwd, "move"),
|
|
235
|
-
}),
|
|
236
|
-
]);
|
|
237
|
-
|
|
238
|
-
// Both publish calls captured distinct --private-key-file args.
|
|
239
|
-
const argsA = a.captured.publishCall!.args;
|
|
240
|
-
const argsB = b.captured.publishCall!.args;
|
|
241
|
-
const keyFileArgA = argsA[argsA.indexOf("--private-key-file") + 1] as string;
|
|
242
|
-
const keyFileArgB = argsB[argsB.indexOf("--private-key-file") + 1] as string;
|
|
243
|
-
expect(keyFileArgA).toMatch(/movehat-key-/);
|
|
244
|
-
expect(keyFileArgB).toMatch(/movehat-key-/);
|
|
245
|
-
expect(keyFileArgA).not.toBe(keyFileArgB);
|
|
246
|
-
|
|
247
|
-
// Cleanup ran on both — neither temp file persists after the
|
|
248
|
-
// deploys finished normally.
|
|
249
|
-
expect(existsSync(keyFileArgA)).toBe(false);
|
|
250
|
-
expect(existsSync(keyFileArgB)).toBe(false);
|
|
251
|
-
|
|
252
|
-
// ~/.aptos/config.yaml byte-identical to pre-deploy state — the new
|
|
253
|
-
// flow never touches the user's CLI config.
|
|
254
|
-
expect(readFileSync(configPath, "utf8")).toBe(initialConfigBytes);
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
it("SIGINT mid-deploy unlinks the temp key file", async () => {
|
|
258
|
-
// Without sync SIGINT cleanup, the temp private-key file written
|
|
259
|
-
// by `writeTempKeyFile` would persist on disk after an abnormal
|
|
260
|
-
// exit (chmod 0o600 prevents other users from reading it, but
|
|
261
|
-
// forensic recovery from /tmp is still possible). The sync signal
|
|
262
|
-
// handler runs synchronously before process.exit and unlinks
|
|
263
|
-
// every active deploy's key file.
|
|
264
|
-
//
|
|
265
|
-
// This test spawns a child process running a harness that drives
|
|
266
|
-
// Publisher.deploy() with a 3-second-delayed publish, then sends
|
|
267
|
-
// SIGINT mid-flight. Vitest's own process is unaffected because
|
|
268
|
-
// the SIGINT goes to the child.
|
|
269
|
-
|
|
270
|
-
// Seed an unrelated user profile that MUST be left untouched —
|
|
271
|
-
// the new flow doesn't read or write ~/.aptos/config.yaml at all,
|
|
272
|
-
// so this is an invariant check.
|
|
273
|
-
const aptosDir = join(tmpHome, ".aptos");
|
|
274
|
-
mkdirSync(aptosDir, { recursive: true });
|
|
275
|
-
const configPath = join(aptosDir, "config.yaml");
|
|
276
|
-
writeFileSync(
|
|
277
|
-
configPath,
|
|
278
|
-
yaml.dump({
|
|
279
|
-
profiles: {
|
|
280
|
-
user_main: {
|
|
281
|
-
private_key: "0x" + "a".repeat(64),
|
|
282
|
-
public_key: "0x" + "b".repeat(64),
|
|
283
|
-
account: "0x" + "c".repeat(64),
|
|
284
|
-
rest_url: "https://example.invalid/v1",
|
|
285
|
-
},
|
|
286
|
-
},
|
|
287
|
-
}),
|
|
288
|
-
{ mode: 0o600 }
|
|
289
|
-
);
|
|
290
|
-
const initialConfigBytes = readFileSync(configPath, "utf8");
|
|
291
|
-
|
|
292
|
-
const harnessPath = join(__dirname, "fixtures", "sigint-deploy-harness.ts");
|
|
293
|
-
// Resolve tsx's CLI binary by absolute path — the test's tmp cwd has
|
|
294
|
-
// no node_modules, so a bare `tsx` import would fail to resolve.
|
|
295
|
-
// `require.resolve("tsx")` returns the package's main (dist/loader.mjs);
|
|
296
|
-
// the binary is two levels up from there, in `<root>/dist/cli.mjs`
|
|
297
|
-
// (same trick `commands/run.ts:49-53` uses).
|
|
298
|
-
const tsxMain = require.resolve("tsx");
|
|
299
|
-
const tsxCliPath = join(dirname(dirname(tsxMain)), "dist", "cli.mjs");
|
|
300
|
-
const child = spawn(
|
|
301
|
-
process.execPath,
|
|
302
|
-
[tsxCliPath, harnessPath],
|
|
303
|
-
{
|
|
304
|
-
env: { ...process.env, HOME: tmpHome },
|
|
305
|
-
cwd: tmpCwd,
|
|
306
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
307
|
-
}
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
// Wait for the harness to announce its temp key file path via stdout
|
|
311
|
-
// (it writes a JSON line `{"keyFile":"/tmp/movehat-key-XXXX"}` just
|
|
312
|
-
// before entering the slow publish step).
|
|
313
|
-
let announced: string | undefined;
|
|
314
|
-
let stdoutBuf = "";
|
|
315
|
-
let stderrBuf = "";
|
|
316
|
-
child.stdout?.on("data", (chunk: Buffer) => {
|
|
317
|
-
stdoutBuf += chunk.toString();
|
|
318
|
-
for (const line of stdoutBuf.split("\n")) {
|
|
319
|
-
const trimmed = line.trim();
|
|
320
|
-
if (!trimmed.startsWith("{")) continue;
|
|
321
|
-
try {
|
|
322
|
-
const parsed = JSON.parse(trimmed);
|
|
323
|
-
if (typeof parsed.keyFile === "string") announced = parsed.keyFile;
|
|
324
|
-
} catch {
|
|
325
|
-
/* not a JSON line we care about */
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
child.stderr?.on("data", (c: Buffer) => (stderrBuf += c.toString()));
|
|
330
|
-
|
|
331
|
-
// Poll until the harness has announced OR 8s timeout (the import +
|
|
332
|
-
// SDK initialization can take a few seconds in CI/cold-start).
|
|
333
|
-
const start = Date.now();
|
|
334
|
-
while (!announced && Date.now() - start < 8000) {
|
|
335
|
-
await new Promise((r) => setTimeout(r, 100));
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (!announced) {
|
|
339
|
-
child.kill("SIGKILL");
|
|
340
|
-
throw new Error(
|
|
341
|
-
`harness never announced keyFile in 8s.\n` +
|
|
342
|
-
`stdout so far:\n${stdoutBuf}\n---\nstderr so far:\n${stderrBuf}`
|
|
343
|
-
);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
expect(announced).toMatch(/movehat-key-/);
|
|
347
|
-
// The temp key file is present on disk while the harness is in
|
|
348
|
-
// the middle of the slow publish (the JSON announcement is emitted
|
|
349
|
-
// right before the simulated 3s wait, and the file is unlinked
|
|
350
|
-
// only on cleanup).
|
|
351
|
-
expect(existsSync(announced)).toBe(true);
|
|
352
|
-
|
|
353
|
-
// Deliver SIGINT mid-publish and wait for the harness to exit.
|
|
354
|
-
child.kill("SIGINT");
|
|
355
|
-
const exitCode = await new Promise<number | null>((resolve) => {
|
|
356
|
-
child.on("exit", (code) => resolve(code));
|
|
357
|
-
});
|
|
358
|
-
expect(exitCode).toBe(130);
|
|
359
|
-
|
|
360
|
-
// The temp key file has been unlinked by the SIGINT handler.
|
|
361
|
-
expect(existsSync(announced)).toBe(false);
|
|
362
|
-
|
|
363
|
-
// The user's ~/.aptos/config.yaml is byte-identical to pre-deploy
|
|
364
|
-
// — the new flow never touches it.
|
|
365
|
-
expect(readFileSync(configPath, "utf8")).toBe(initialConfigBytes);
|
|
366
|
-
}, 15000);
|
|
367
|
-
|
|
368
|
-
it("does not mutate Move.toml during deploy (#38)", async () => {
|
|
369
|
-
// Pre-fix #38: deployContract overwrote every entry under [addresses]
|
|
370
|
-
// with the deployer address, then relied on `finally` to restore.
|
|
371
|
-
// Post-fix: Move.toml is never touched — `--named-addresses` carries
|
|
372
|
-
// the overrides on the CLI line for both build and publish.
|
|
373
|
-
const moveTomlPath = join(tmpCwd, "move", "Move.toml");
|
|
374
|
-
const moveTomlContent = `[package]
|
|
375
|
-
name = "dummy"
|
|
376
|
-
version = "0.0.1"
|
|
377
|
-
|
|
378
|
-
[addresses]
|
|
379
|
-
counter = "0x42"
|
|
380
|
-
greeting = "0xcafe"
|
|
381
|
-
`;
|
|
382
|
-
writeFileSync(moveTomlPath, moveTomlContent);
|
|
383
|
-
|
|
384
|
-
// Move source that references "counter" so extractNamedAddresses picks
|
|
385
|
-
// it up — otherwise the --named-addresses arg is empty and the test
|
|
386
|
-
// is uninteresting.
|
|
387
|
-
writeFileSync(
|
|
388
|
-
join(tmpCwd, "move", "sources", "dummy.move"),
|
|
389
|
-
"module counter::dummy { }\n"
|
|
390
|
-
);
|
|
391
|
-
|
|
392
|
-
const { adapter } = makeAdapter({
|
|
393
|
-
build: { exitCode: 0, stdout: "build ok", stderr: "" },
|
|
394
|
-
publish: {
|
|
395
|
-
exitCode: 0,
|
|
396
|
-
stdout: "Transaction hash: 0x" + "c".repeat(64),
|
|
397
|
-
stderr: "",
|
|
398
|
-
},
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
const runtime = await initRuntime();
|
|
402
|
-
await runtime.deployContract("counter", { adapter });
|
|
403
|
-
|
|
404
|
-
const after = readFileSync(moveTomlPath, "utf8");
|
|
405
|
-
expect(after).toBe(moveTomlContent);
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
it("leak path #1 — console.error on a noisy-but-successful publish never sees raw key", async () => {
|
|
409
|
-
const rawKey = "ed25519-priv-0x" + "a".repeat(64);
|
|
410
|
-
const { adapter } = makeAdapter({
|
|
411
|
-
build: { exitCode: 0, stdout: "build ok", stderr: "" },
|
|
412
|
-
// Publish succeeds (exitCode 0) but emits a stderr line containing the key.
|
|
413
|
-
publish: {
|
|
414
|
-
exitCode: 0,
|
|
415
|
-
stdout: "Transaction hash: 0x" + "b".repeat(64),
|
|
416
|
-
stderr: `warning: ${rawKey}`,
|
|
417
|
-
},
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
const errSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
|
421
|
-
const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
|
|
422
|
-
|
|
423
|
-
try {
|
|
424
|
-
const runtime = await initRuntime();
|
|
425
|
-
await runtime.deployContract("mymodule", { adapter });
|
|
426
|
-
|
|
427
|
-
const allErr = errSpy.mock.calls.flat().join("\n");
|
|
428
|
-
const allLog = logSpy.mock.calls.flat().join("\n");
|
|
429
|
-
expect(allErr).not.toContain("ed25519-priv-");
|
|
430
|
-
expect(allErr).not.toContain(rawKey);
|
|
431
|
-
expect(allLog).not.toContain("ed25519-priv-");
|
|
432
|
-
expect(allLog).not.toContain(rawKey);
|
|
433
|
-
} finally {
|
|
434
|
-
errSpy.mockRestore();
|
|
435
|
-
logSpy.mockRestore();
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
});
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { ModuleAlreadyDeployedError } from '../errors.js';
|
|
3
|
-
|
|
4
|
-
describe('ModuleAlreadyDeployedError', () => {
|
|
5
|
-
it('should create error with all properties', () => {
|
|
6
|
-
const error = new ModuleAlreadyDeployedError(
|
|
7
|
-
'Module "counter" is already deployed',
|
|
8
|
-
'counter',
|
|
9
|
-
'testnet',
|
|
10
|
-
'0x1234',
|
|
11
|
-
1704985623564,
|
|
12
|
-
'0xabcd'
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
expect(error).toBeInstanceOf(Error);
|
|
16
|
-
expect(error).toBeInstanceOf(ModuleAlreadyDeployedError);
|
|
17
|
-
expect(error.name).toBe('ModuleAlreadyDeployedError');
|
|
18
|
-
expect(error.message).toBe('Module "counter" is already deployed');
|
|
19
|
-
expect(error.moduleName).toBe('counter');
|
|
20
|
-
expect(error.network).toBe('testnet');
|
|
21
|
-
expect(error.address).toBe('0x1234');
|
|
22
|
-
expect(error.timestamp).toBe(1704985623564);
|
|
23
|
-
expect(error.txHash).toBe('0xabcd');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('should work without optional txHash', () => {
|
|
27
|
-
const error = new ModuleAlreadyDeployedError(
|
|
28
|
-
'Module already deployed',
|
|
29
|
-
'token',
|
|
30
|
-
'mainnet',
|
|
31
|
-
'0x5678',
|
|
32
|
-
1704985623564
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
expect(error.moduleName).toBe('token');
|
|
36
|
-
expect(error.network).toBe('mainnet');
|
|
37
|
-
expect(error.txHash).toBeUndefined();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('should have proper stack trace', () => {
|
|
41
|
-
const error = new ModuleAlreadyDeployedError(
|
|
42
|
-
'Test error',
|
|
43
|
-
'test',
|
|
44
|
-
'local',
|
|
45
|
-
'0x0',
|
|
46
|
-
Date.now()
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
expect(error.stack).toBeDefined();
|
|
50
|
-
expect(error.stack).toContain('ModuleAlreadyDeployedError');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should be catchable as Error', () => {
|
|
54
|
-
const throwError = () => {
|
|
55
|
-
throw new ModuleAlreadyDeployedError(
|
|
56
|
-
'Test',
|
|
57
|
-
'module',
|
|
58
|
-
'testnet',
|
|
59
|
-
'0x1',
|
|
60
|
-
Date.now()
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
expect(throwError).toThrow(Error);
|
|
65
|
-
expect(throwError).toThrow(ModuleAlreadyDeployedError);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should allow instanceof checks', () => {
|
|
69
|
-
try {
|
|
70
|
-
throw new ModuleAlreadyDeployedError(
|
|
71
|
-
'Test',
|
|
72
|
-
'module',
|
|
73
|
-
'testnet',
|
|
74
|
-
'0x1',
|
|
75
|
-
Date.now()
|
|
76
|
-
);
|
|
77
|
-
} catch (e) {
|
|
78
|
-
expect(e instanceof ModuleAlreadyDeployedError).toBe(true);
|
|
79
|
-
if (e instanceof ModuleAlreadyDeployedError) {
|
|
80
|
-
expect(e.moduleName).toBe('module');
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import * as publicSurface from "../index.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Locks the public export surface of `movehat`. Adding a new symbol
|
|
6
|
-
* is a deliberate API change; removing one is a breaking change.
|
|
7
|
-
* Update this list (and the CHANGELOG) when the surface evolves.
|
|
8
|
-
*/
|
|
9
|
-
const EXPECTED_RUNTIME_EXPORTS = [
|
|
10
|
-
"Harness",
|
|
11
|
-
"HarnessDisposedError",
|
|
12
|
-
"ForkManager",
|
|
13
|
-
"MovementApiClient",
|
|
14
|
-
"ForkStorage",
|
|
15
|
-
"ForkServer",
|
|
16
|
-
"ModuleAlreadyDeployedError",
|
|
17
|
-
"PostPublishError",
|
|
18
|
-
"initRuntime",
|
|
19
|
-
] as const;
|
|
20
|
-
|
|
21
|
-
describe("public export surface (movehat root)", () => {
|
|
22
|
-
it.each(EXPECTED_RUNTIME_EXPORTS)("exports %s as a runtime value", (name) => {
|
|
23
|
-
expect(publicSurface[name as keyof typeof publicSurface]).toBeDefined();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Type-only exports cannot be probed at runtime; the assertion is
|
|
27
|
-
// that the module imports successfully (failing types-only export
|
|
28
|
-
// would surface as a TS error in `pnpm check:example`).
|
|
29
|
-
it("imports without errors", () => {
|
|
30
|
-
expect(typeof publicSurface).toBe("object");
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stand-alone child-process harness for the SIGINT-cleanup test in
|
|
3
|
-
* `deployContract.test.ts`. Run via tsx by the parent test; never picked
|
|
4
|
-
* up by vitest's test glob (default matches `*.{test,spec}.?(c|m)[jt]s`).
|
|
5
|
-
*
|
|
6
|
-
* Behavior:
|
|
7
|
-
* 1. Build a fake ChildProcessAdapter whose `publish` step awaits a
|
|
8
|
-
* long delay (3 seconds) — gives the parent test plenty of time to
|
|
9
|
-
* send SIGINT mid-flight.
|
|
10
|
-
* 2. Drive `Publisher.deploy()` against the fake adapter using a
|
|
11
|
-
* synthetic MovehatConfig + Account read from env vars.
|
|
12
|
-
* 3. Write the temp key file path to stdout as JSON
|
|
13
|
-
* (`{"keyFile": "/tmp/movehat-key-<uuid>"}`) before the slow
|
|
14
|
-
* publish so the parent test knows which file to look for after
|
|
15
|
-
* SIGINT.
|
|
16
|
-
* 4. If the deploy completes naturally (test failure case), exit 0.
|
|
17
|
-
* 5. When SIGINT arrives, Publisher's signal handler runs synchronous
|
|
18
|
-
* cleanup and `setImmediate(() => process.exit(130))`.
|
|
19
|
-
*
|
|
20
|
-
* The parent test does NOT import this file — it spawns it via
|
|
21
|
-
* `child_process.spawn(node, [tsx, harness, ...])` so the harness runs
|
|
22
|
-
* in its own process with its own signal-handler installation.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import { Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
|
|
26
|
-
import { Publisher } from "../../core/Publisher.js";
|
|
27
|
-
import type {
|
|
28
|
-
ChildProcessAdapter,
|
|
29
|
-
RunInput,
|
|
30
|
-
RunResult,
|
|
31
|
-
} from "../../utils/childProcessAdapter.js";
|
|
32
|
-
import type { MovehatConfig } from "../../types/config.js";
|
|
33
|
-
|
|
34
|
-
// Deterministic test key — must satisfy the Movement TypeScript SDK's Ed25519 parser.
|
|
35
|
-
// Same key the testnet auto-config uses in `core/config.ts:147-155`.
|
|
36
|
-
const TEST_PRIVATE_KEY =
|
|
37
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001";
|
|
38
|
-
|
|
39
|
-
async function main() {
|
|
40
|
-
const account = Account.fromPrivateKey({
|
|
41
|
-
privateKey: new Ed25519PrivateKey(TEST_PRIVATE_KEY),
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const config: MovehatConfig = {
|
|
45
|
-
network: "testnet",
|
|
46
|
-
rpc: "https://testnet.invalid/v1",
|
|
47
|
-
privateKey: TEST_PRIVATE_KEY,
|
|
48
|
-
allAccounts: [TEST_PRIVATE_KEY],
|
|
49
|
-
profile: "default",
|
|
50
|
-
moveDir: "./move",
|
|
51
|
-
account: account.accountAddress.toString(),
|
|
52
|
-
namedAddresses: {},
|
|
53
|
-
networkConfig: {
|
|
54
|
-
url: "https://testnet.invalid/v1",
|
|
55
|
-
chainId: "testnet",
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const slowPublishAdapter: ChildProcessAdapter = {
|
|
60
|
-
async run(input: RunInput): Promise<RunResult> {
|
|
61
|
-
if (input.args[1] === "build") {
|
|
62
|
-
return { exitCode: 0, stdout: "built", stderr: "" };
|
|
63
|
-
}
|
|
64
|
-
if (input.args[1] === "publish") {
|
|
65
|
-
// Surface the temp key file path to the parent BEFORE blocking.
|
|
66
|
-
const keyFileIdx = input.args.indexOf("--private-key-file");
|
|
67
|
-
const keyFile = keyFileIdx >= 0 ? input.args[keyFileIdx + 1] : "";
|
|
68
|
-
process.stdout.write(JSON.stringify({ keyFile }) + "\n");
|
|
69
|
-
// Hold long enough for the parent to deliver SIGINT.
|
|
70
|
-
await new Promise((r) => setTimeout(r, 3000));
|
|
71
|
-
return {
|
|
72
|
-
exitCode: 0,
|
|
73
|
-
stdout: "Transaction hash: 0x" + "f".repeat(64),
|
|
74
|
-
stderr: "",
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
throw new Error(`unexpected subcommand: ${input.args[1]}`);
|
|
78
|
-
},
|
|
79
|
-
spawn() {
|
|
80
|
-
throw new Error("spawn not used");
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const publisher = new Publisher({ adapter: slowPublishAdapter });
|
|
85
|
-
await publisher.deploy({
|
|
86
|
-
moduleName: "sigint_harness",
|
|
87
|
-
config,
|
|
88
|
-
account,
|
|
89
|
-
packageDir: process.cwd(),
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
main().catch((err) => {
|
|
94
|
-
process.stderr.write(`harness error: ${(err as Error).message}\n`);
|
|
95
|
-
process.exit(2);
|
|
96
|
-
});
|