movehat 0.2.3 → 0.2.5
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 +0 -1
- package/dist/commands/run.js +0 -1
- 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 +0 -1
- 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 +15 -2
- package/dist/fork/manager.js +20 -2
- 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 +2 -3
- 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 +1 -2
- package/dist/node/LocalNodeManager.js +6 -4
- 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 +0 -1
- package/dist/utils/parseCliOutput.js +0 -1
- 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,579 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { EventEmitter } from "node:events";
|
|
3
|
-
import { PassThrough } from "node:stream";
|
|
4
|
-
import { mkdtempSync, rmSync, existsSync, mkdirSync } from "node:fs";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
import { join } from "node:path";
|
|
7
|
-
|
|
8
|
-
import { LocalNodeManager } from "../LocalNodeManager.js";
|
|
9
|
-
import type {
|
|
10
|
-
ChildProcessAdapter,
|
|
11
|
-
SpawnInput,
|
|
12
|
-
SpawnedProcess,
|
|
13
|
-
} from "../../utils/childProcessAdapter.js";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Tests for `LocalNodeManager`.
|
|
17
|
-
*
|
|
18
|
-
* Strategy:
|
|
19
|
-
* - Inject a fake `ChildProcessAdapter` so we control the spawn
|
|
20
|
-
* handle (stdout/stderr streams, kill semantics, exit promise).
|
|
21
|
-
* - Stub global `fetch` so the ready/faucet endpoints return
|
|
22
|
-
* controllable responses without real HTTP.
|
|
23
|
-
*
|
|
24
|
-
* What we DON'T test here:
|
|
25
|
-
* - The 60-second ready timeout in real-time (would block the suite).
|
|
26
|
-
* Instead we either stub fetch to succeed on first call, or for the
|
|
27
|
-
* timeout-path test we shrink the timeout via a wrapper that bypasses
|
|
28
|
-
* `start()` and calls a faster path. The timeout error message is
|
|
29
|
-
* verified by exercising `start()` with a never-ready fetch and
|
|
30
|
-
* fake timers.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
interface FakeSpawnedProcess extends SpawnedProcess {
|
|
34
|
-
/** Test helper — manually trigger the "exited" promise resolution. */
|
|
35
|
-
__exit: (code: number | null, signal: NodeJS.Signals | null) => void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function buildFakeSpawned(): FakeSpawnedProcess {
|
|
39
|
-
const stdout = new PassThrough();
|
|
40
|
-
const stderr = new PassThrough();
|
|
41
|
-
const stdin = new PassThrough();
|
|
42
|
-
let exitResolve!: (v: { code: number | null; signal: NodeJS.Signals | null }) => void;
|
|
43
|
-
const exited = new Promise<{ code: number | null; signal: NodeJS.Signals | null }>(
|
|
44
|
-
(resolve) => {
|
|
45
|
-
exitResolve = resolve;
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
let killed = false;
|
|
49
|
-
const proc: FakeSpawnedProcess = {
|
|
50
|
-
pid: 4242,
|
|
51
|
-
stdout,
|
|
52
|
-
stderr,
|
|
53
|
-
stdin,
|
|
54
|
-
kill: (_signal?: NodeJS.Signals) => {
|
|
55
|
-
if (killed) return false;
|
|
56
|
-
killed = true;
|
|
57
|
-
// Resolve `exited` shortly after kill so `stop()` doesn't hang.
|
|
58
|
-
setImmediate(() => exitResolve({ code: null, signal: _signal ?? "SIGTERM" }));
|
|
59
|
-
return true;
|
|
60
|
-
},
|
|
61
|
-
exited,
|
|
62
|
-
__exit: (code, signal) => exitResolve({ code, signal }),
|
|
63
|
-
};
|
|
64
|
-
return proc;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function buildFakeAdapter(): {
|
|
68
|
-
adapter: ChildProcessAdapter;
|
|
69
|
-
calls: SpawnInput[];
|
|
70
|
-
spawned: FakeSpawnedProcess[];
|
|
71
|
-
} {
|
|
72
|
-
const calls: SpawnInput[] = [];
|
|
73
|
-
const spawned: FakeSpawnedProcess[] = [];
|
|
74
|
-
const adapter: ChildProcessAdapter = {
|
|
75
|
-
run: vi.fn(),
|
|
76
|
-
spawn: (input) => {
|
|
77
|
-
calls.push(input);
|
|
78
|
-
const proc = buildFakeSpawned();
|
|
79
|
-
spawned.push(proc);
|
|
80
|
-
return proc;
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
return { adapter, calls, spawned };
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function stubFetchOnce(response: { ok: boolean; text?: () => Promise<string>; json?: () => Promise<unknown> }) {
|
|
87
|
-
const fn = vi.fn().mockResolvedValueOnce(response);
|
|
88
|
-
vi.stubGlobal("fetch", fn);
|
|
89
|
-
return fn;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function stubFetchAlwaysOk() {
|
|
93
|
-
const fn = vi.fn().mockResolvedValue({ ok: true, json: async () => ({}) });
|
|
94
|
-
vi.stubGlobal("fetch", fn);
|
|
95
|
-
return fn;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
describe("LocalNodeManager — start / stop / lifecycle", () => {
|
|
99
|
-
let tmpDir: string;
|
|
100
|
-
let logSpy: ReturnType<typeof vi.spyOn>;
|
|
101
|
-
let errSpy: ReturnType<typeof vi.spyOn>;
|
|
102
|
-
|
|
103
|
-
beforeEach(() => {
|
|
104
|
-
tmpDir = mkdtempSync(join(tmpdir(), "movehat-localnode-"));
|
|
105
|
-
// The logger prints to stdout/stderr; silence the noise for cleaner test output.
|
|
106
|
-
logSpy = vi.spyOn(console, "log").mockImplementation(() => undefined);
|
|
107
|
-
errSpy = vi.spyOn(console, "error").mockImplementation(() => undefined);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
afterEach(() => {
|
|
111
|
-
vi.restoreAllMocks();
|
|
112
|
-
vi.unstubAllGlobals();
|
|
113
|
-
if (existsSync(tmpDir)) {
|
|
114
|
-
rmSync(tmpDir, { recursive: true, force: true });
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it("constructs with sensible defaults from getNodeInfo", () => {
|
|
119
|
-
const { adapter } = buildFakeAdapter();
|
|
120
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
121
|
-
|
|
122
|
-
const info = mgr.getNodeInfo();
|
|
123
|
-
expect(info.rpcUrl).toBe("http://127.0.0.1:8080");
|
|
124
|
-
expect(info.faucetUrl).toBe("http://127.0.0.1:8081");
|
|
125
|
-
expect(info.readyUrl).toBe("http://127.0.0.1:8070");
|
|
126
|
-
expect(info.testDir).toBe(tmpDir);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("honors custom faucet/ready ports; apiPort is pinned to 8080 (see F9)", () => {
|
|
130
|
-
const { adapter } = buildFakeAdapter();
|
|
131
|
-
const mgr = new LocalNodeManager({
|
|
132
|
-
adapter,
|
|
133
|
-
testDir: tmpDir,
|
|
134
|
-
faucetPort: 9001,
|
|
135
|
-
readyPort: 9002,
|
|
136
|
-
});
|
|
137
|
-
const info = mgr.getNodeInfo();
|
|
138
|
-
// Movement CLI does not accept a flag for the REST API port; see
|
|
139
|
-
// LocalNodeManager.api-port.test.ts for the F9 contract.
|
|
140
|
-
expect(info.rpcUrl).toBe("http://127.0.0.1:8080");
|
|
141
|
-
expect(info.faucetUrl).toContain(":9001");
|
|
142
|
-
expect(info.readyUrl).toContain(":9002");
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it("isRunning reports false before start", () => {
|
|
146
|
-
const { adapter } = buildFakeAdapter();
|
|
147
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
148
|
-
expect(mgr.isRunning()).toBe(false);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it("start spawns 'movement node run-localnet' with the expected args", async () => {
|
|
152
|
-
const { adapter, calls } = buildFakeAdapter();
|
|
153
|
-
stubFetchAlwaysOk();
|
|
154
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
155
|
-
|
|
156
|
-
await mgr.start();
|
|
157
|
-
|
|
158
|
-
expect(calls).toHaveLength(1);
|
|
159
|
-
expect(calls[0]?.command).toBe("movement");
|
|
160
|
-
const args = calls[0]?.args ?? [];
|
|
161
|
-
expect(args.slice(0, 2)).toEqual(["node", "run-localnet"]);
|
|
162
|
-
expect(args).toContain("--test-dir");
|
|
163
|
-
expect(args).toContain(tmpDir);
|
|
164
|
-
expect(args).toContain("--faucet-port");
|
|
165
|
-
expect(args).toContain("8081");
|
|
166
|
-
expect(args).toContain("--assume-yes");
|
|
167
|
-
expect(mgr.isRunning()).toBe(true);
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
it("start in silent mode does not wire stdout/stderr listeners", async () => {
|
|
171
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
172
|
-
stubFetchAlwaysOk();
|
|
173
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
174
|
-
|
|
175
|
-
await mgr.start();
|
|
176
|
-
|
|
177
|
-
// The PassThrough streams should have no `data` listeners attached
|
|
178
|
-
// when `silent: true` is set.
|
|
179
|
-
const proc = spawned[0]!;
|
|
180
|
-
expect(proc.stdout!.listenerCount("data")).toBe(0);
|
|
181
|
-
expect(proc.stderr!.listenerCount("data")).toBe(0);
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it("start in non-silent mode wires stdout/stderr listeners that respect §9 filtering", async () => {
|
|
185
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
186
|
-
stubFetchAlwaysOk();
|
|
187
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: false });
|
|
188
|
-
|
|
189
|
-
await mgr.start();
|
|
190
|
-
|
|
191
|
-
const proc = spawned[0]!;
|
|
192
|
-
expect(proc.stdout!.listenerCount("data")).toBeGreaterThan(0);
|
|
193
|
-
expect(proc.stderr!.listenerCount("data")).toBeGreaterThan(0);
|
|
194
|
-
// Detailed filter behavior — what passes through vs what's gated
|
|
195
|
-
// behind isVerbose() — lives in the "§9 console UX" describe block
|
|
196
|
-
// below. This test only locks the listener-wiring contract.
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
it("force-restart cleans the test directory before spawn", async () => {
|
|
200
|
-
const { adapter } = buildFakeAdapter();
|
|
201
|
-
stubFetchAlwaysOk();
|
|
202
|
-
const planted = join(tmpDir, "stale-file.txt");
|
|
203
|
-
// Create a stale file to prove the cleanup actually removes it.
|
|
204
|
-
mkdirSync(tmpDir, { recursive: true });
|
|
205
|
-
require("node:fs").writeFileSync(planted, "stale");
|
|
206
|
-
expect(existsSync(planted)).toBe(true);
|
|
207
|
-
|
|
208
|
-
const mgr = new LocalNodeManager({
|
|
209
|
-
adapter,
|
|
210
|
-
testDir: tmpDir,
|
|
211
|
-
forceRestart: true,
|
|
212
|
-
silent: true,
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
await mgr.start();
|
|
216
|
-
expect(existsSync(planted)).toBe(false);
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it("force-restart appends --force-restart to the CLI args", async () => {
|
|
220
|
-
const { adapter, calls } = buildFakeAdapter();
|
|
221
|
-
stubFetchAlwaysOk();
|
|
222
|
-
const mgr = new LocalNodeManager({
|
|
223
|
-
adapter,
|
|
224
|
-
testDir: tmpDir,
|
|
225
|
-
forceRestart: true,
|
|
226
|
-
silent: true,
|
|
227
|
-
});
|
|
228
|
-
await mgr.start();
|
|
229
|
-
expect(calls[0]?.args).toContain("--force-restart");
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
it("calling start twice returns the same node info (idempotent)", async () => {
|
|
233
|
-
const { adapter, calls } = buildFakeAdapter();
|
|
234
|
-
stubFetchAlwaysOk();
|
|
235
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
236
|
-
|
|
237
|
-
const info1 = await mgr.start();
|
|
238
|
-
const info2 = await mgr.start();
|
|
239
|
-
expect(info2).toEqual(info1);
|
|
240
|
-
expect(calls).toHaveLength(1);
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
it("stop signals SIGTERM and clears the spawned handle", async () => {
|
|
244
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
245
|
-
stubFetchAlwaysOk();
|
|
246
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
247
|
-
await mgr.start();
|
|
248
|
-
|
|
249
|
-
const killSpy = vi.spyOn(spawned[0]!, "kill");
|
|
250
|
-
await mgr.stop();
|
|
251
|
-
|
|
252
|
-
expect(killSpy).toHaveBeenCalledWith("SIGTERM");
|
|
253
|
-
expect(mgr.isRunning()).toBe(false);
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
it("stop is a no-op when no node is running", async () => {
|
|
257
|
-
const { adapter } = buildFakeAdapter();
|
|
258
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
259
|
-
// Should not throw.
|
|
260
|
-
await mgr.stop();
|
|
261
|
-
expect(mgr.isRunning()).toBe(false);
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
it("clean refuses while the node is running", async () => {
|
|
265
|
-
const { adapter } = buildFakeAdapter();
|
|
266
|
-
stubFetchAlwaysOk();
|
|
267
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
268
|
-
await mgr.start();
|
|
269
|
-
|
|
270
|
-
await expect(mgr.clean()).rejects.toThrow(/Cannot clean while node is running/);
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
it("clean removes the test directory after stop", async () => {
|
|
274
|
-
const { adapter } = buildFakeAdapter();
|
|
275
|
-
stubFetchAlwaysOk();
|
|
276
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
277
|
-
await mgr.start();
|
|
278
|
-
await mgr.stop();
|
|
279
|
-
|
|
280
|
-
expect(existsSync(tmpDir)).toBe(true);
|
|
281
|
-
await mgr.clean();
|
|
282
|
-
expect(existsSync(tmpDir)).toBe(false);
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
it("clean is a no-op when the test directory doesn't exist", async () => {
|
|
286
|
-
const { adapter } = buildFakeAdapter();
|
|
287
|
-
const missing = join(tmpDir, "never-created");
|
|
288
|
-
const mgr = new LocalNodeManager({ adapter, testDir: missing });
|
|
289
|
-
// Should not throw.
|
|
290
|
-
await mgr.clean();
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
describe("LocalNodeManager — start failure paths", () => {
|
|
295
|
-
let tmpDir: string;
|
|
296
|
-
|
|
297
|
-
beforeEach(() => {
|
|
298
|
-
tmpDir = mkdtempSync(join(tmpdir(), "movehat-localnode-"));
|
|
299
|
-
vi.spyOn(console, "log").mockImplementation(() => undefined);
|
|
300
|
-
vi.spyOn(console, "error").mockImplementation(() => undefined);
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
afterEach(() => {
|
|
304
|
-
vi.restoreAllMocks();
|
|
305
|
-
vi.unstubAllGlobals();
|
|
306
|
-
if (existsSync(tmpDir)) rmSync(tmpDir, { recursive: true, force: true });
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
it("waitForReady timeout surfaces a clear error AND cleans up the spawn", async () => {
|
|
310
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
311
|
-
// Always-failing fetch — node never becomes ready.
|
|
312
|
-
vi.stubGlobal(
|
|
313
|
-
"fetch",
|
|
314
|
-
vi.fn().mockRejectedValue(new Error("ECONNREFUSED"))
|
|
315
|
-
);
|
|
316
|
-
|
|
317
|
-
vi.useFakeTimers();
|
|
318
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
319
|
-
|
|
320
|
-
// Attach the .catch handler synchronously so the eventual rejection
|
|
321
|
-
// never lands as an unhandled promise. vi.advanceTimersByTimeAsync
|
|
322
|
-
// drives the waitForReady loop forward; we then await the captured
|
|
323
|
-
// error and assert on it.
|
|
324
|
-
let captured: unknown;
|
|
325
|
-
const startPromise = mgr.start().catch((e) => {
|
|
326
|
-
captured = e;
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
// Drive the 60s timeout forward — each loop iteration does fetch +
|
|
330
|
-
// sleep(1000). Advance well past 60 000 ms.
|
|
331
|
-
await vi.advanceTimersByTimeAsync(61_000);
|
|
332
|
-
await startPromise;
|
|
333
|
-
|
|
334
|
-
expect(captured).toBeInstanceOf(Error);
|
|
335
|
-
expect((captured as Error).message).toMatch(/did not become ready/);
|
|
336
|
-
// The spawn handle must have been killed in the catch arm.
|
|
337
|
-
expect(spawned[0]).toBeDefined();
|
|
338
|
-
expect(mgr.isRunning()).toBe(false);
|
|
339
|
-
vi.useRealTimers();
|
|
340
|
-
});
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
describe("LocalNodeManager — fundAccount", () => {
|
|
344
|
-
let tmpDir: string;
|
|
345
|
-
|
|
346
|
-
beforeEach(() => {
|
|
347
|
-
tmpDir = mkdtempSync(join(tmpdir(), "movehat-localnode-"));
|
|
348
|
-
vi.spyOn(console, "log").mockImplementation(() => undefined);
|
|
349
|
-
vi.spyOn(console, "error").mockImplementation(() => undefined);
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
afterEach(() => {
|
|
353
|
-
vi.restoreAllMocks();
|
|
354
|
-
vi.unstubAllGlobals();
|
|
355
|
-
if (existsSync(tmpDir)) rmSync(tmpDir, { recursive: true, force: true });
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
it("rejects when called before the node is running", async () => {
|
|
359
|
-
const { adapter } = buildFakeAdapter();
|
|
360
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
361
|
-
await expect(mgr.fundAccount("0xabc", 100)).rejects.toThrow(
|
|
362
|
-
/Local node is not running/
|
|
363
|
-
);
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
it("posts to the faucet endpoint and returns the parsed JSON on success", async () => {
|
|
367
|
-
const { adapter } = buildFakeAdapter();
|
|
368
|
-
// First fetch = ready check; subsequent = faucet mint.
|
|
369
|
-
const fetchFn = vi.fn();
|
|
370
|
-
fetchFn.mockResolvedValueOnce({ ok: true }); // waitForReady
|
|
371
|
-
fetchFn.mockResolvedValueOnce({
|
|
372
|
-
ok: true,
|
|
373
|
-
json: async () => ({ txn_hashes: ["0xdeadbeef"] }),
|
|
374
|
-
}); // faucet
|
|
375
|
-
vi.stubGlobal("fetch", fetchFn);
|
|
376
|
-
|
|
377
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
378
|
-
await mgr.start();
|
|
379
|
-
|
|
380
|
-
const addr = "0x" + "1".repeat(64);
|
|
381
|
-
const result = await mgr.fundAccount(addr, 12345);
|
|
382
|
-
|
|
383
|
-
expect(result).toEqual({ txn_hashes: ["0xdeadbeef"] });
|
|
384
|
-
const faucetCall = fetchFn.mock.calls[1]!;
|
|
385
|
-
expect(faucetCall[0]).toContain("/mint?amount=12345&address=" + addr);
|
|
386
|
-
expect(faucetCall[1]?.method).toBe("POST");
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
it("rethrows a clear error when the faucet returns non-ok", async () => {
|
|
390
|
-
const { adapter } = buildFakeAdapter();
|
|
391
|
-
const fetchFn = vi.fn();
|
|
392
|
-
fetchFn.mockResolvedValueOnce({ ok: true }); // waitForReady
|
|
393
|
-
fetchFn.mockResolvedValueOnce({
|
|
394
|
-
ok: false,
|
|
395
|
-
text: async () => "out of funds",
|
|
396
|
-
json: async () => ({}),
|
|
397
|
-
});
|
|
398
|
-
vi.stubGlobal("fetch", fetchFn);
|
|
399
|
-
|
|
400
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
401
|
-
await mgr.start();
|
|
402
|
-
|
|
403
|
-
await expect(mgr.fundAccount("0xabc", 100)).rejects.toThrow(
|
|
404
|
-
/Failed to fund account.*out of funds/
|
|
405
|
-
);
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
it("fundAccount accepts an Account-like object by reading accountAddress.toString()", async () => {
|
|
409
|
-
const { adapter } = buildFakeAdapter();
|
|
410
|
-
const fetchFn = vi.fn();
|
|
411
|
-
fetchFn.mockResolvedValueOnce({ ok: true }); // waitForReady
|
|
412
|
-
fetchFn.mockResolvedValueOnce({
|
|
413
|
-
ok: true,
|
|
414
|
-
json: async () => ({}),
|
|
415
|
-
});
|
|
416
|
-
vi.stubGlobal("fetch", fetchFn);
|
|
417
|
-
|
|
418
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
419
|
-
await mgr.start();
|
|
420
|
-
|
|
421
|
-
const fakeAccount = {
|
|
422
|
-
accountAddress: { toString: () => "0xfeedbeef" },
|
|
423
|
-
} as never; // exercises the typeof-not-string branch
|
|
424
|
-
|
|
425
|
-
await mgr.fundAccount(fakeAccount, 100);
|
|
426
|
-
expect(fetchFn.mock.calls[1]![0]).toContain("address=0xfeedbeef");
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
it("fundAccounts iterates and funds each account in turn", async () => {
|
|
430
|
-
const { adapter } = buildFakeAdapter();
|
|
431
|
-
const fetchFn = vi.fn();
|
|
432
|
-
fetchFn.mockResolvedValueOnce({ ok: true }); // waitForReady
|
|
433
|
-
fetchFn.mockResolvedValue({ ok: true, json: async () => ({}) });
|
|
434
|
-
vi.stubGlobal("fetch", fetchFn);
|
|
435
|
-
|
|
436
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir, silent: true });
|
|
437
|
-
await mgr.start();
|
|
438
|
-
|
|
439
|
-
await mgr.fundAccounts(["0x1", "0x2", "0x3"], 100);
|
|
440
|
-
// 1 ready + 3 mint calls = 4 total.
|
|
441
|
-
expect(fetchFn.mock.calls.length).toBeGreaterThanOrEqual(4);
|
|
442
|
-
});
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
describe("LocalNodeManager — subprocess output filtering (§9 console UX)", () => {
|
|
446
|
-
let tmpDir: string;
|
|
447
|
-
let logSpy: ReturnType<typeof vi.spyOn>;
|
|
448
|
-
let errSpy: ReturnType<typeof vi.spyOn>;
|
|
449
|
-
let warnSpy: ReturnType<typeof vi.spyOn>;
|
|
450
|
-
|
|
451
|
-
beforeEach(() => {
|
|
452
|
-
tmpDir = mkdtempSync(join(tmpdir(), "movehat-localnode-filter-"));
|
|
453
|
-
logSpy = vi.spyOn(console, "log").mockImplementation(() => undefined);
|
|
454
|
-
errSpy = vi.spyOn(console, "error").mockImplementation(() => undefined);
|
|
455
|
-
warnSpy = vi.spyOn(console, "warn").mockImplementation(() => undefined);
|
|
456
|
-
// Ensure quiet mode is the default for each test; the verbose tests
|
|
457
|
-
// set MOVEHAT_VERBOSE explicitly inside their own scope.
|
|
458
|
-
delete process.env.MOVEHAT_VERBOSE;
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
afterEach(() => {
|
|
462
|
-
vi.restoreAllMocks();
|
|
463
|
-
vi.unstubAllGlobals();
|
|
464
|
-
delete process.env.MOVEHAT_VERBOSE;
|
|
465
|
-
if (existsSync(tmpDir)) {
|
|
466
|
-
rmSync(tmpDir, { recursive: true, force: true });
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
it("hides routine stdout chatter from the movement node in quiet mode", async () => {
|
|
471
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
472
|
-
stubFetchAlwaysOk();
|
|
473
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
474
|
-
await mgr.start();
|
|
475
|
-
|
|
476
|
-
const proc = spawned[0]!;
|
|
477
|
-
logSpy.mockClear();
|
|
478
|
-
|
|
479
|
-
// Push routine chatter — exactly the noise we used to spam to stdout.
|
|
480
|
-
proc.stdout!.emit("data", Buffer.from("Loading aptos framework module"));
|
|
481
|
-
proc.stdout!.emit("data", Buffer.from("Compiling Move bytecode"));
|
|
482
|
-
proc.stdout!.emit("data", Buffer.from("aptos_account: account created"));
|
|
483
|
-
|
|
484
|
-
// None of these should have reached stdout (no `[Node]` prefix, no
|
|
485
|
-
// muted gray `›` prefix). The only console.log calls that may arise
|
|
486
|
-
// are from the spinner mock falling back to plain text — but since
|
|
487
|
-
// ora auto-disables in non-TTY (vitest is non-TTY), even those are
|
|
488
|
-
// suppressed.
|
|
489
|
-
const stdoutCalls = logSpy.mock.calls.flat().join(" ");
|
|
490
|
-
expect(stdoutCalls).not.toContain("Loading aptos framework module");
|
|
491
|
-
expect(stdoutCalls).not.toContain("Compiling Move bytecode");
|
|
492
|
-
expect(stdoutCalls).not.toContain("aptos_account: account created");
|
|
493
|
-
});
|
|
494
|
-
|
|
495
|
-
it("always surfaces panic / fatal lines as warnings, even in quiet mode", async () => {
|
|
496
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
497
|
-
stubFetchAlwaysOk();
|
|
498
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
499
|
-
await mgr.start();
|
|
500
|
-
|
|
501
|
-
const proc = spawned[0]!;
|
|
502
|
-
warnSpy.mockClear();
|
|
503
|
-
|
|
504
|
-
proc.stdout!.emit("data", Buffer.from("thread 'main' panicked at 'state corrupted'"));
|
|
505
|
-
|
|
506
|
-
const warnCalls = warnSpy.mock.calls.flat().join(" ");
|
|
507
|
-
expect(warnCalls).toContain("panicked");
|
|
508
|
-
});
|
|
509
|
-
|
|
510
|
-
it("surfaces 'address already in use' (port conflict) regardless of verbosity", async () => {
|
|
511
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
512
|
-
stubFetchAlwaysOk();
|
|
513
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
514
|
-
await mgr.start();
|
|
515
|
-
|
|
516
|
-
const proc = spawned[0]!;
|
|
517
|
-
warnSpy.mockClear();
|
|
518
|
-
|
|
519
|
-
proc.stdout!.emit(
|
|
520
|
-
"data",
|
|
521
|
-
Buffer.from("error: address already in use: 127.0.0.1:8080"),
|
|
522
|
-
);
|
|
523
|
-
|
|
524
|
-
const warnCalls = warnSpy.mock.calls.flat().join(" ");
|
|
525
|
-
expect(warnCalls).toContain("address already in use");
|
|
526
|
-
});
|
|
527
|
-
|
|
528
|
-
it("surfaces stdout chatter with gray prefix in verbose mode", async () => {
|
|
529
|
-
process.env.MOVEHAT_VERBOSE = "1";
|
|
530
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
531
|
-
stubFetchAlwaysOk();
|
|
532
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
533
|
-
await mgr.start();
|
|
534
|
-
|
|
535
|
-
const proc = spawned[0]!;
|
|
536
|
-
logSpy.mockClear();
|
|
537
|
-
|
|
538
|
-
proc.stdout!.emit("data", Buffer.from("Loading aptos framework module"));
|
|
539
|
-
|
|
540
|
-
const stdoutCalls = logSpy.mock.calls.flat().join(" ");
|
|
541
|
-
expect(stdoutCalls).toContain("Loading aptos framework module");
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
it("always surfaces critical stderr (panic/EADDRINUSE) via logger.error", async () => {
|
|
545
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
546
|
-
stubFetchAlwaysOk();
|
|
547
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
548
|
-
await mgr.start();
|
|
549
|
-
|
|
550
|
-
const proc = spawned[0]!;
|
|
551
|
-
errSpy.mockClear();
|
|
552
|
-
|
|
553
|
-
proc.stderr!.emit("data", Buffer.from("thread panicked: failed to bind socket"));
|
|
554
|
-
|
|
555
|
-
const stderrCalls = errSpy.mock.calls.flat().join(" ");
|
|
556
|
-
expect(stderrCalls).toContain("panicked");
|
|
557
|
-
});
|
|
558
|
-
|
|
559
|
-
it("hides routine progress stderr in quiet mode (Movement CLI emits progress to stderr too)", async () => {
|
|
560
|
-
const { adapter, spawned } = buildFakeAdapter();
|
|
561
|
-
stubFetchAlwaysOk();
|
|
562
|
-
const mgr = new LocalNodeManager({ adapter, testDir: tmpDir });
|
|
563
|
-
await mgr.start();
|
|
564
|
-
|
|
565
|
-
const proc = spawned[0]!;
|
|
566
|
-
errSpy.mockClear();
|
|
567
|
-
|
|
568
|
-
// The movement subprocess emits progress messages to stderr that
|
|
569
|
-
// are NOT errors: "Applying post startup steps...", "Compiling,
|
|
570
|
-
// may take a little while...". Hiding stream channel from the
|
|
571
|
-
// user keeps the console clean.
|
|
572
|
-
proc.stderr!.emit("data", Buffer.from("Applying post startup steps..."));
|
|
573
|
-
proc.stderr!.emit("data", Buffer.from("[WARN] deprecated config field"));
|
|
574
|
-
|
|
575
|
-
const stderrCalls = errSpy.mock.calls.flat().join(" ");
|
|
576
|
-
expect(stderrCalls).not.toContain("Applying post startup steps");
|
|
577
|
-
expect(stderrCalls).not.toContain("deprecated config field");
|
|
578
|
-
});
|
|
579
|
-
});
|