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,245 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
|
|
5
|
-
import { Harness } from "../../harness/index.js";
|
|
6
|
-
import { CliExecutionError } from "../../errors.js";
|
|
7
|
-
import type {
|
|
8
|
-
ChildProcessAdapter,
|
|
9
|
-
RunInput,
|
|
10
|
-
RunResult,
|
|
11
|
-
} from "../../utils/childProcessAdapter.js";
|
|
12
|
-
import { setupHarnessTestFixture, type HarnessTestFixture } from "./_fixture.js";
|
|
13
|
-
|
|
14
|
-
describe("Harness.runMoveScript", () => {
|
|
15
|
-
let fixture: HarnessTestFixture;
|
|
16
|
-
|
|
17
|
-
const TX_HASH =
|
|
18
|
-
"0x9999999999999999999999999999999999999999999999999999999999999999";
|
|
19
|
-
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
fixture = setupHarnessTestFixture({ withTmpHome: true });
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
afterEach(() => {
|
|
25
|
-
fixture.teardown();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
function makeAdapter(result: RunResult): {
|
|
29
|
-
adapter: ChildProcessAdapter;
|
|
30
|
-
calls: RunInput[];
|
|
31
|
-
} {
|
|
32
|
-
const calls: RunInput[] = [];
|
|
33
|
-
const adapter: ChildProcessAdapter = {
|
|
34
|
-
async run(input) {
|
|
35
|
-
calls.push(input);
|
|
36
|
-
if (input.args[1] === "run-script") return result;
|
|
37
|
-
throw new Error(`unexpected movement subcommand: ${input.args[1]}`);
|
|
38
|
-
},
|
|
39
|
-
spawn() {
|
|
40
|
-
throw new Error("spawn not used in script tests");
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
return { adapter, calls };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function successStdout(): string {
|
|
47
|
-
return [
|
|
48
|
-
`transaction hash: ${TX_HASH}`,
|
|
49
|
-
'{ "Result": { "success": true, "vm_status": "Executed successfully" } }',
|
|
50
|
-
].join("\n");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
it("happy path with .move source: uses --script-path and returns parsed MoveScriptResult", async () => {
|
|
54
|
-
const scriptPath = join(fixture.tmpCwd, "scripts", "init.move");
|
|
55
|
-
mkdirSync(join(fixture.tmpCwd, "scripts"), { recursive: true });
|
|
56
|
-
writeFileSync(scriptPath, "// dummy move script\n");
|
|
57
|
-
|
|
58
|
-
const { adapter, calls } = makeAdapter({
|
|
59
|
-
exitCode: 0,
|
|
60
|
-
stdout: successStdout(),
|
|
61
|
-
stderr: "",
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const harness = await Harness.createLive("testnet");
|
|
65
|
-
try {
|
|
66
|
-
const result = await harness.runMoveScript({
|
|
67
|
-
scriptPath,
|
|
68
|
-
args: ["u64:42", "bool:true"],
|
|
69
|
-
typeArgs: ["0x1::aptos_coin::AptosCoin"],
|
|
70
|
-
adapter,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
expect(result.txHash).toBe(TX_HASH);
|
|
74
|
-
expect(result.success).toBe(true);
|
|
75
|
-
expect(result.vmStatus).toBe("Executed successfully");
|
|
76
|
-
|
|
77
|
-
expect(calls).toHaveLength(1);
|
|
78
|
-
const call = calls[0]!;
|
|
79
|
-
expect(call.args.slice(0, 2)).toEqual(["move", "run-script"]);
|
|
80
|
-
expect(call.args).toContain("--script-path");
|
|
81
|
-
expect(call.args).not.toContain("--compiled-script-path");
|
|
82
|
-
expect(call.args).toContain(scriptPath);
|
|
83
|
-
expect(call.args).toContain("--type-args");
|
|
84
|
-
expect(call.args).toContain("0x1::aptos_coin::AptosCoin");
|
|
85
|
-
expect(call.args).toContain("--args");
|
|
86
|
-
expect(call.args).toContain("u64:42");
|
|
87
|
-
expect(call.args).toContain("bool:true");
|
|
88
|
-
} finally {
|
|
89
|
-
await harness.cleanup();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it("happy path with .mv compiled: uses --compiled-script-path", async () => {
|
|
94
|
-
const scriptPath = join(fixture.tmpCwd, "build", "init.mv");
|
|
95
|
-
mkdirSync(join(fixture.tmpCwd, "build"), { recursive: true });
|
|
96
|
-
writeFileSync(scriptPath, "compiled bytecode placeholder");
|
|
97
|
-
|
|
98
|
-
const { adapter, calls } = makeAdapter({
|
|
99
|
-
exitCode: 0,
|
|
100
|
-
stdout: successStdout(),
|
|
101
|
-
stderr: "",
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const harness = await Harness.createLive("testnet");
|
|
105
|
-
try {
|
|
106
|
-
const result = await harness.runMoveScript({ scriptPath, adapter });
|
|
107
|
-
|
|
108
|
-
expect(result.txHash).toBe(TX_HASH);
|
|
109
|
-
const call = calls[0]!;
|
|
110
|
-
expect(call.args).toContain("--compiled-script-path");
|
|
111
|
-
expect(call.args).not.toContain("--script-path");
|
|
112
|
-
} finally {
|
|
113
|
-
await harness.cleanup();
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it("unsupported extension throws synchronously before any CLI call", async () => {
|
|
118
|
-
const scriptPath = join(fixture.tmpCwd, "notes.txt");
|
|
119
|
-
writeFileSync(scriptPath, "not a script");
|
|
120
|
-
|
|
121
|
-
const { adapter, calls } = makeAdapter({
|
|
122
|
-
exitCode: 0,
|
|
123
|
-
stdout: successStdout(),
|
|
124
|
-
stderr: "",
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const harness = await Harness.createLive("testnet");
|
|
128
|
-
try {
|
|
129
|
-
let caught: unknown;
|
|
130
|
-
try {
|
|
131
|
-
await harness.runMoveScript({ scriptPath, adapter });
|
|
132
|
-
} catch (err) {
|
|
133
|
-
caught = err;
|
|
134
|
-
}
|
|
135
|
-
expect(caught).toBeInstanceOf(Error);
|
|
136
|
-
expect((caught as Error).message).toMatch(/unsupported script extension/i);
|
|
137
|
-
expect(calls).toHaveLength(0);
|
|
138
|
-
} finally {
|
|
139
|
-
await harness.cleanup();
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it("missing script file throws before any CLI call", async () => {
|
|
144
|
-
const scriptPath = join(fixture.tmpCwd, "scripts", "missing.move");
|
|
145
|
-
const { adapter, calls } = makeAdapter({
|
|
146
|
-
exitCode: 0,
|
|
147
|
-
stdout: successStdout(),
|
|
148
|
-
stderr: "",
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
const harness = await Harness.createLive("testnet");
|
|
152
|
-
try {
|
|
153
|
-
let caught: unknown;
|
|
154
|
-
try {
|
|
155
|
-
await harness.runMoveScript({ scriptPath, adapter });
|
|
156
|
-
} catch (err) {
|
|
157
|
-
caught = err;
|
|
158
|
-
}
|
|
159
|
-
expect(caught).toBeInstanceOf(Error);
|
|
160
|
-
expect((caught as Error).message).toMatch(/script not found/i);
|
|
161
|
-
expect(calls).toHaveLength(0);
|
|
162
|
-
} finally {
|
|
163
|
-
await harness.cleanup();
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it("CLI failure rethrows CliExecutionError and removes the temp profile", async () => {
|
|
168
|
-
const scriptPath = join(fixture.tmpCwd, "scripts", "fail.move");
|
|
169
|
-
mkdirSync(join(fixture.tmpCwd, "scripts"), { recursive: true });
|
|
170
|
-
writeFileSync(scriptPath, "// dummy\n");
|
|
171
|
-
|
|
172
|
-
const { adapter } = makeAdapter({
|
|
173
|
-
exitCode: 1,
|
|
174
|
-
stdout: "",
|
|
175
|
-
stderr: "compile error: undefined identifier",
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
const harness = await Harness.createLive("testnet");
|
|
179
|
-
try {
|
|
180
|
-
let caught: unknown;
|
|
181
|
-
try {
|
|
182
|
-
await harness.runMoveScript({ scriptPath, adapter });
|
|
183
|
-
} catch (err) {
|
|
184
|
-
caught = err;
|
|
185
|
-
}
|
|
186
|
-
expect(caught).toBeInstanceOf(CliExecutionError);
|
|
187
|
-
// Temp profile cleaned up in finally.
|
|
188
|
-
expect(existsSync(join(fixture.tmpHome!, ".aptos", "config.yaml"))).toBe(false);
|
|
189
|
-
} finally {
|
|
190
|
-
await harness.cleanup();
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it("CLI succeeded but output has no txHash: throws clear non-CliExecutionError", async () => {
|
|
195
|
-
const scriptPath = join(fixture.tmpCwd, "scripts", "weird.move");
|
|
196
|
-
mkdirSync(join(fixture.tmpCwd, "scripts"), { recursive: true });
|
|
197
|
-
writeFileSync(scriptPath, "// dummy\n");
|
|
198
|
-
|
|
199
|
-
const { adapter } = makeAdapter({
|
|
200
|
-
exitCode: 0,
|
|
201
|
-
stdout: "ran successfully but no hash here",
|
|
202
|
-
stderr: "",
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
const harness = await Harness.createLive("testnet");
|
|
206
|
-
try {
|
|
207
|
-
let caught: unknown;
|
|
208
|
-
try {
|
|
209
|
-
await harness.runMoveScript({ scriptPath, adapter });
|
|
210
|
-
} catch (err) {
|
|
211
|
-
caught = err;
|
|
212
|
-
}
|
|
213
|
-
expect(caught).toBeInstanceOf(Error);
|
|
214
|
-
expect(caught).not.toBeInstanceOf(CliExecutionError);
|
|
215
|
-
expect((caught as Error).message).toMatch(/Could not parse transaction hash/);
|
|
216
|
-
} finally {
|
|
217
|
-
await harness.cleanup();
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
it("`success: false` in Result JSON surfaces in MoveScriptResult.success", async () => {
|
|
222
|
-
const scriptPath = join(fixture.tmpCwd, "scripts", "bad.move");
|
|
223
|
-
mkdirSync(join(fixture.tmpCwd, "scripts"), { recursive: true });
|
|
224
|
-
writeFileSync(scriptPath, "// dummy\n");
|
|
225
|
-
|
|
226
|
-
const { adapter } = makeAdapter({
|
|
227
|
-
exitCode: 0,
|
|
228
|
-
stdout: [
|
|
229
|
-
`transaction hash: ${TX_HASH}`,
|
|
230
|
-
'{ "Result": { "success": false, "vm_status": "ABORTED" } }',
|
|
231
|
-
].join("\n"),
|
|
232
|
-
stderr: "",
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
const harness = await Harness.createLive("testnet");
|
|
236
|
-
try {
|
|
237
|
-
const result = await harness.runMoveScript({ scriptPath, adapter });
|
|
238
|
-
expect(result.txHash).toBe(TX_HASH);
|
|
239
|
-
expect(result.success).toBe(false);
|
|
240
|
-
expect(result.vmStatus).toBe("ABORTED");
|
|
241
|
-
} finally {
|
|
242
|
-
await harness.cleanup();
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
});
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { Harness } from "../../harness/index.js";
|
|
4
|
-
import { setupHarnessTestFixture, type HarnessTestFixture } from "./_fixture.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Tests for `Harness.runViewFunction` — the SDK delegation path.
|
|
8
|
-
*
|
|
9
|
-
* The Aptos SDK isn't behind an injectable adapter, so we monkey-patch
|
|
10
|
-
* `harness.runtime.aptos.view` after `createLive`. Acceptable here
|
|
11
|
-
* because the function under test is a 6-line wrapper that only
|
|
12
|
-
* forwards options.
|
|
13
|
-
*/
|
|
14
|
-
describe("Harness.runViewFunction", () => {
|
|
15
|
-
let fixture: HarnessTestFixture;
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
fixture = setupHarnessTestFixture();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
afterEach(() => {
|
|
22
|
-
fixture.teardown();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("happy path: forwards correct payload to aptos.view and returns the raw result array", async () => {
|
|
26
|
-
const harness = await Harness.createLive("testnet");
|
|
27
|
-
try {
|
|
28
|
-
const fake = vi.fn().mockResolvedValue([42n, "hello"]);
|
|
29
|
-
// Monkey-patch — the SDK boundary isn't behind an adapter.
|
|
30
|
-
harness.runtime.aptos.view = fake as never;
|
|
31
|
-
|
|
32
|
-
const result = await harness.runViewFunction({
|
|
33
|
-
function: "0xCAFE::counter::get",
|
|
34
|
-
typeArguments: ["0x1::aptos_coin::AptosCoin"],
|
|
35
|
-
functionArguments: ["0xdeployer", 1n],
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
expect(result).toEqual([42n, "hello"]);
|
|
39
|
-
expect(fake).toHaveBeenCalledTimes(1);
|
|
40
|
-
expect(fake).toHaveBeenCalledWith({
|
|
41
|
-
payload: {
|
|
42
|
-
function: "0xCAFE::counter::get",
|
|
43
|
-
typeArguments: ["0x1::aptos_coin::AptosCoin"],
|
|
44
|
-
functionArguments: ["0xdeployer", 1n],
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
} finally {
|
|
48
|
-
await harness.cleanup();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("defaults typeArguments and functionArguments to empty arrays when omitted", async () => {
|
|
53
|
-
const harness = await Harness.createLive("testnet");
|
|
54
|
-
try {
|
|
55
|
-
const fake = vi.fn().mockResolvedValue([0n]);
|
|
56
|
-
harness.runtime.aptos.view = fake as never;
|
|
57
|
-
|
|
58
|
-
const result = await harness.runViewFunction({
|
|
59
|
-
function: "0xCAFE::counter::count",
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
expect(result).toEqual([0n]);
|
|
63
|
-
expect(fake).toHaveBeenCalledWith({
|
|
64
|
-
payload: {
|
|
65
|
-
function: "0xCAFE::counter::count",
|
|
66
|
-
typeArguments: [],
|
|
67
|
-
functionArguments: [],
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
} finally {
|
|
71
|
-
await harness.cleanup();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("passes empty results through unchanged", async () => {
|
|
76
|
-
const harness = await Harness.createLive("testnet");
|
|
77
|
-
try {
|
|
78
|
-
const fake = vi.fn().mockResolvedValue([]);
|
|
79
|
-
harness.runtime.aptos.view = fake as never;
|
|
80
|
-
|
|
81
|
-
const result = await harness.runViewFunction({
|
|
82
|
-
function: "0xCAFE::nothing::nothing",
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
expect(result).toEqual([]);
|
|
86
|
-
} finally {
|
|
87
|
-
await harness.cleanup();
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("rethrows errors from aptos.view", async () => {
|
|
92
|
-
const harness = await Harness.createLive("testnet");
|
|
93
|
-
try {
|
|
94
|
-
const fake = vi.fn().mockRejectedValue(new Error("module not found"));
|
|
95
|
-
harness.runtime.aptos.view = fake as never;
|
|
96
|
-
|
|
97
|
-
await expect(
|
|
98
|
-
harness.runViewFunction({ function: "0xCAFE::missing::get" })
|
|
99
|
-
).rejects.toThrow(/module not found/);
|
|
100
|
-
} finally {
|
|
101
|
-
await harness.cleanup();
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
|
|
6
|
-
import { initRuntime } from "../runtime.js";
|
|
7
|
-
import { _resetConfigCache } from "../core/config.js";
|
|
8
|
-
import { AccountManager } from "../core/AccountManager.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Behavioral tests for `runtime.ts` covering the paths
|
|
12
|
-
* `__tests__/deployContract.test.ts` doesn't exercise:
|
|
13
|
-
* - initRuntime returns a fully-wired MovehatRuntime
|
|
14
|
-
* - accountIndex selection + out-of-range error
|
|
15
|
-
* - config override merging
|
|
16
|
-
* - getAccountByIndex bounds error
|
|
17
|
-
* - switchNetwork delegates back into initRuntime
|
|
18
|
-
*
|
|
19
|
-
* Mainnet/security gates live in `resolveNetworkConfig` and are
|
|
20
|
-
* covered in `core/__tests__/config.test.ts` to avoid re-driving the
|
|
21
|
-
* same branch through two layers.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const TEST_KEY_A =
|
|
25
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001";
|
|
26
|
-
const TEST_KEY_B =
|
|
27
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
28
|
-
|
|
29
|
-
function writeConfig(cwd: string, body: string): void {
|
|
30
|
-
writeFileSync(join(cwd, "movehat.config.js"), body);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const CONFIG_TWO_NETWORKS_TWO_ACCOUNTS = `export default {
|
|
34
|
-
defaultNetwork: "testnet",
|
|
35
|
-
networks: {
|
|
36
|
-
testnet: {
|
|
37
|
-
url: "https://testnet.movementnetwork.xyz/v1",
|
|
38
|
-
chainId: "testnet",
|
|
39
|
-
accounts: ["${TEST_KEY_A}", "${TEST_KEY_B}"]
|
|
40
|
-
},
|
|
41
|
-
custom: {
|
|
42
|
-
url: "https://custom.example.com/v1",
|
|
43
|
-
chainId: "custom",
|
|
44
|
-
accounts: ["${TEST_KEY_A}"]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
`;
|
|
49
|
-
|
|
50
|
-
describe("initRuntime", () => {
|
|
51
|
-
let tmpCwd: string;
|
|
52
|
-
let origCwd: string;
|
|
53
|
-
|
|
54
|
-
beforeEach(() => {
|
|
55
|
-
origCwd = process.cwd();
|
|
56
|
-
tmpCwd = mkdtempSync(join(tmpdir(), "movehat-runtime-test-"));
|
|
57
|
-
process.chdir(tmpCwd);
|
|
58
|
-
_resetConfigCache();
|
|
59
|
-
AccountManager.clearPool();
|
|
60
|
-
writeConfig(tmpCwd, CONFIG_TWO_NETWORKS_TWO_ACCOUNTS);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
afterEach(() => {
|
|
64
|
-
process.chdir(origCwd);
|
|
65
|
-
rmSync(tmpCwd, { recursive: true, force: true });
|
|
66
|
-
_resetConfigCache();
|
|
67
|
-
AccountManager.clearPool();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it("returns a runtime bound to defaultNetwork when no network is passed", async () => {
|
|
71
|
-
const runtime = await initRuntime();
|
|
72
|
-
|
|
73
|
-
expect(runtime.network.name).toBe("testnet");
|
|
74
|
-
expect(runtime.network.rpc).toContain("testnet.movementnetwork.xyz");
|
|
75
|
-
expect(runtime.config.network).toBe("testnet");
|
|
76
|
-
expect(runtime.aptos).toBeDefined();
|
|
77
|
-
expect(runtime.account).toBeDefined();
|
|
78
|
-
// accounts array reflects both keys configured.
|
|
79
|
-
expect(runtime.accounts).toHaveLength(2);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it("switches network via the `network` option", async () => {
|
|
83
|
-
const runtime = await initRuntime({ network: "custom" });
|
|
84
|
-
|
|
85
|
-
expect(runtime.network.name).toBe("custom");
|
|
86
|
-
expect(runtime.network.rpc).toContain("custom.example.com");
|
|
87
|
-
expect(runtime.accounts).toHaveLength(1);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it("selects a specific account via `accountIndex`", async () => {
|
|
91
|
-
const runtime = await initRuntime({ accountIndex: 1 });
|
|
92
|
-
|
|
93
|
-
// The primary `account` is the indexed pick.
|
|
94
|
-
expect(runtime.account.accountAddress.toString()).toBe(
|
|
95
|
-
runtime.accounts[1]!.accountAddress.toString()
|
|
96
|
-
);
|
|
97
|
-
expect(runtime.account.accountAddress.toString()).not.toBe(
|
|
98
|
-
runtime.accounts[0]!.accountAddress.toString()
|
|
99
|
-
);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it("throws a clear error when accountIndex is out of range", async () => {
|
|
103
|
-
await expect(initRuntime({ accountIndex: 5 })).rejects.toThrow(
|
|
104
|
-
/Account index 5 not found/
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it("merges `configOverride` on top of the loaded user config", async () => {
|
|
109
|
-
const runtime = await initRuntime({
|
|
110
|
-
configOverride: { defaultNetwork: "custom" },
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// The override flips defaultNetwork → 'custom' so resolveNetworkConfig
|
|
114
|
-
// picks the custom entry without requiring an explicit `network` arg.
|
|
115
|
-
expect(runtime.network.name).toBe("custom");
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it("getAccountByIndex returns the account at the given slot", async () => {
|
|
119
|
-
const runtime = await initRuntime();
|
|
120
|
-
expect(runtime.getAccountByIndex(0).accountAddress.toString()).toBe(
|
|
121
|
-
runtime.accounts[0]!.accountAddress.toString()
|
|
122
|
-
);
|
|
123
|
-
expect(runtime.getAccountByIndex(1).accountAddress.toString()).toBe(
|
|
124
|
-
runtime.accounts[1]!.accountAddress.toString()
|
|
125
|
-
);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it("getAccountByIndex throws on out-of-range index", async () => {
|
|
129
|
-
const runtime = await initRuntime();
|
|
130
|
-
expect(() => runtime.getAccountByIndex(99)).toThrow(
|
|
131
|
-
/Account index 99 out of range/
|
|
132
|
-
);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it("createAccount returns a fresh account each call (pool grows)", async () => {
|
|
136
|
-
const runtime = await initRuntime();
|
|
137
|
-
const before = AccountManager.getPoolSize();
|
|
138
|
-
const a = runtime.createAccount();
|
|
139
|
-
const b = runtime.createAccount();
|
|
140
|
-
expect(a.accountAddress.toString()).not.toBe(b.accountAddress.toString());
|
|
141
|
-
expect(AccountManager.getPoolSize()).toBe(before + 2);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it("getAccount loads from a private key hex", async () => {
|
|
145
|
-
const runtime = await initRuntime();
|
|
146
|
-
const acc = runtime.getAccount(TEST_KEY_B);
|
|
147
|
-
expect(acc.accountAddress.toString()).toBe(
|
|
148
|
-
runtime.accounts[1]!.accountAddress.toString()
|
|
149
|
-
);
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it("switchNetwork returns a new runtime bound to the requested network", async () => {
|
|
153
|
-
const runtime = await initRuntime();
|
|
154
|
-
expect(runtime.network.name).toBe("testnet");
|
|
155
|
-
|
|
156
|
-
const switched = await runtime.switchNetwork("custom");
|
|
157
|
-
expect(switched.network.name).toBe("custom");
|
|
158
|
-
expect(switched.network.rpc).toContain("custom.example.com");
|
|
159
|
-
// Original runtime is unaffected — switchNetwork builds fresh.
|
|
160
|
-
expect(runtime.network.name).toBe("testnet");
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it("getDeployment / getDeployments / getDeploymentAddress return null/empty for an unused network", async () => {
|
|
164
|
-
const runtime = await initRuntime();
|
|
165
|
-
// Nothing deployed in the tmp cwd, so these all short-circuit.
|
|
166
|
-
expect(runtime.getDeployment("counter")).toBeNull();
|
|
167
|
-
expect(runtime.getDeployments()).toEqual({});
|
|
168
|
-
expect(runtime.getDeploymentAddress("counter")).toBeNull();
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it("getContract returns a MoveContract bound to the requested address+module", async () => {
|
|
172
|
-
const runtime = await initRuntime();
|
|
173
|
-
const dummyAddr = "0x" + "a".repeat(64);
|
|
174
|
-
const contract = runtime.getContract(dummyAddr, "counter");
|
|
175
|
-
expect(contract).toBeDefined();
|
|
176
|
-
// MoveContract holds the address+module pair; assert shape, not behavior
|
|
177
|
-
// (call/view would require a real chain).
|
|
178
|
-
expect(contract).toHaveProperty("call");
|
|
179
|
-
expect(contract).toHaveProperty("view");
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
|
package/src/cli.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Command, InvalidOptionArgumentError } from 'commander';
|
|
3
|
-
import { readFileSync } from 'fs';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
import { dirname, join } from 'path';
|
|
6
|
-
import testCommand from './commands/test.js';
|
|
7
|
-
import testMoveCommand from './commands/test-move.js';
|
|
8
|
-
import compileCommand from './commands/compile.js';
|
|
9
|
-
import initCommand from './commands/init.js';
|
|
10
|
-
import runCommand from './commands/run.js';
|
|
11
|
-
import updateCommand from './commands/update.js';
|
|
12
|
-
import forkCreateCommand from './commands/fork/create.js';
|
|
13
|
-
import forkViewResourceCommand from './commands/fork/view-resource.js';
|
|
14
|
-
import forkFundCommand from './commands/fork/fund.js';
|
|
15
|
-
import forkListCommand from './commands/fork/list.js';
|
|
16
|
-
import forkServeCommand from './commands/fork/serve.js';
|
|
17
|
-
import { checkForUpdates } from './helpers/version-check.js';
|
|
18
|
-
|
|
19
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
-
const __dirname = dirname(__filename);
|
|
21
|
-
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
22
|
-
const version = packageJson.version;
|
|
23
|
-
const packageName = packageJson.name;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Parse and validate port number
|
|
27
|
-
*/
|
|
28
|
-
function parsePort(value: string): number {
|
|
29
|
-
const port = Number.parseInt(value, 10);
|
|
30
|
-
if (isNaN(port) || port < 1 || port > 65535) {
|
|
31
|
-
throw new InvalidOptionArgumentError('Port must be an integer between 1 and 65535');
|
|
32
|
-
}
|
|
33
|
-
return port;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Check for updates at startup (skip if running update command or help)
|
|
37
|
-
const args = process.argv.slice(2);
|
|
38
|
-
const isUpdateCommand = args.includes('update');
|
|
39
|
-
const isHelpOnly = args.length === 0 || args.includes('-h') || args.includes('--help');
|
|
40
|
-
|
|
41
|
-
if (!isUpdateCommand && !isHelpOnly) {
|
|
42
|
-
checkForUpdates(version, packageName);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const program = new Command();
|
|
46
|
-
|
|
47
|
-
program
|
|
48
|
-
.name('movehat')
|
|
49
|
-
.description('A CLI tool for managing Move smart contracts')
|
|
50
|
-
.version(version)
|
|
51
|
-
.option('--network <name>', 'Network to use (testnet, mainnet, local, etc.)')
|
|
52
|
-
.option('--redeploy', 'Force redeploy even if already deployed')
|
|
53
|
-
.option('-v, --verbose', 'Show subprocess output (movement node, aptos move) for debugging')
|
|
54
|
-
.hook('preAction', (thisCommand) => {
|
|
55
|
-
// Store network option in environment for commands to access
|
|
56
|
-
const options = thisCommand.opts();
|
|
57
|
-
if (options.network) {
|
|
58
|
-
process.env.MH_CLI_NETWORK = options.network;
|
|
59
|
-
}
|
|
60
|
-
if (options.redeploy) {
|
|
61
|
-
process.env.MH_CLI_REDEPLOY = 'true';
|
|
62
|
-
}
|
|
63
|
-
if (options.verbose) {
|
|
64
|
-
process.env.MOVEHAT_VERBOSE = '1';
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
program
|
|
69
|
-
.command('init [project-name]')
|
|
70
|
-
.description('Initialize a new Move project in the current directory')
|
|
71
|
-
.action((projectName) => {
|
|
72
|
-
initCommand(projectName);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
program
|
|
76
|
-
.command('compile')
|
|
77
|
-
.description('Compile Move smart contracts using Movement CLI')
|
|
78
|
-
.action(compileCommand);
|
|
79
|
-
|
|
80
|
-
program
|
|
81
|
-
.command('run <script>')
|
|
82
|
-
.description('Run a TypeScript/JavaScript script (e.g., deployment script)')
|
|
83
|
-
.action(runCommand);
|
|
84
|
-
|
|
85
|
-
program
|
|
86
|
-
.command('test')
|
|
87
|
-
.description('Run tests (interactive menu if no flags provided)')
|
|
88
|
-
.option('--move', 'Run only Move unit tests (fast, no node required)')
|
|
89
|
-
.option('--ts', 'Run only TypeScript integration tests (starts local node)')
|
|
90
|
-
.option('--all', 'Run all tests (Move + TypeScript)')
|
|
91
|
-
.option('--watch', 'Run TypeScript tests in watch mode (implies --ts)')
|
|
92
|
-
.option('--filter <pattern>', 'Filter Move tests by name pattern')
|
|
93
|
-
// Legacy flags for backward compatibility
|
|
94
|
-
.option('--move-only', 'Alias for --move (deprecated)')
|
|
95
|
-
.option('--ts-only', 'Alias for --ts (deprecated)')
|
|
96
|
-
.action((options) => {
|
|
97
|
-
// --watch implies --ts
|
|
98
|
-
if (options.watch && !options.ts && !options.all) {
|
|
99
|
-
options.ts = true;
|
|
100
|
-
}
|
|
101
|
-
testCommand(options);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
program
|
|
105
|
-
.command('test:move')
|
|
106
|
-
.description('Run Move unit tests')
|
|
107
|
-
.option('--filter <pattern>', 'Filter tests by name pattern')
|
|
108
|
-
.option('--ignore-warnings', 'Ignore compilation warnings')
|
|
109
|
-
.action((options) => testMoveCommand(options));
|
|
110
|
-
|
|
111
|
-
program
|
|
112
|
-
.command('test:ts')
|
|
113
|
-
.description('Run TypeScript integration tests')
|
|
114
|
-
.option('--watch', 'Run tests in watch mode')
|
|
115
|
-
.action((options) => testCommand({ tsOnly: true, watch: options.watch }));
|
|
116
|
-
|
|
117
|
-
program
|
|
118
|
-
.command('update')
|
|
119
|
-
.description('Check for updates and upgrade to the latest version')
|
|
120
|
-
.action(() => updateCommand());
|
|
121
|
-
|
|
122
|
-
// Fork commands
|
|
123
|
-
const fork = program
|
|
124
|
-
.command('fork')
|
|
125
|
-
.description('Manage local forks of Movement networks');
|
|
126
|
-
|
|
127
|
-
fork
|
|
128
|
-
.command('create')
|
|
129
|
-
.description('Create a new fork from a network')
|
|
130
|
-
.option('-n, --name <name>', 'Name for the fork')
|
|
131
|
-
.option('-p, --path <path>', 'Custom path for the fork')
|
|
132
|
-
.action((options) => forkCreateCommand(options));
|
|
133
|
-
|
|
134
|
-
fork
|
|
135
|
-
.command('view-resource')
|
|
136
|
-
.description('View a resource from the fork')
|
|
137
|
-
.option('-f, --fork <path>', 'Path to the fork')
|
|
138
|
-
.requiredOption('-a, --account <address>', 'Account address')
|
|
139
|
-
.requiredOption('-r, --resource <type>', 'Resource type')
|
|
140
|
-
.action((options) => forkViewResourceCommand(options));
|
|
141
|
-
|
|
142
|
-
fork
|
|
143
|
-
.command('fund')
|
|
144
|
-
.description('Fund an account in the fork')
|
|
145
|
-
.option('-f, --fork <path>', 'Path to the fork')
|
|
146
|
-
.requiredOption('-a, --account <address>', 'Account address')
|
|
147
|
-
.requiredOption('--amount <amount>', 'Amount to fund')
|
|
148
|
-
.option('--coin-type <type>', 'Coin type', '0x1::aptos_coin::AptosCoin')
|
|
149
|
-
.action((options) => forkFundCommand(options));
|
|
150
|
-
|
|
151
|
-
fork
|
|
152
|
-
.command('list')
|
|
153
|
-
.description('List all available forks')
|
|
154
|
-
.action(() => forkListCommand());
|
|
155
|
-
|
|
156
|
-
fork
|
|
157
|
-
.command('serve')
|
|
158
|
-
.description('Start a local RPC server serving the fork')
|
|
159
|
-
.option('-f, --fork <path>', 'Path to the fork')
|
|
160
|
-
.option('-p, --port <port>', 'Port to listen on (default: 8080)', parsePort, 8080)
|
|
161
|
-
.option('--host <host>', 'Interface to bind (default: 127.0.0.1; use 0.0.0.0 to expose to LAN)', '127.0.0.1')
|
|
162
|
-
.action((options) => forkServeCommand(options));
|
|
163
|
-
|
|
164
|
-
program.parse(process.argv);
|