movehat 0.1.8 → 0.2.0
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 +2 -2
- package/dist/__tests__/deployContract.test.d.ts +2 -0
- package/dist/__tests__/deployContract.test.d.ts.map +1 -0
- package/dist/__tests__/deployContract.test.js +368 -0
- package/dist/__tests__/deployContract.test.js.map +1 -0
- package/dist/__tests__/errors.test.d.ts +2 -0
- package/dist/__tests__/errors.test.d.ts.map +1 -0
- package/dist/__tests__/errors.test.js +46 -0
- package/dist/__tests__/errors.test.js.map +1 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts +24 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts.map +1 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.js +82 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.js.map +1 -0
- package/dist/__tests__/fork/api.test.d.ts +2 -0
- package/dist/__tests__/fork/api.test.d.ts.map +1 -0
- package/dist/__tests__/fork/api.test.js +110 -0
- package/dist/__tests__/fork/api.test.js.map +1 -0
- package/dist/__tests__/harness/Harness.createLive.test.d.ts +2 -0
- package/dist/__tests__/harness/Harness.createLive.test.d.ts.map +1 -0
- package/dist/__tests__/harness/Harness.createLive.test.js +53 -0
- package/dist/__tests__/harness/Harness.createLive.test.js.map +1 -0
- package/dist/__tests__/harness/Harness.proxy.test.d.ts +2 -0
- package/dist/__tests__/harness/Harness.proxy.test.d.ts.map +1 -0
- package/dist/__tests__/harness/Harness.proxy.test.js +93 -0
- package/dist/__tests__/harness/Harness.proxy.test.js.map +1 -0
- package/dist/__tests__/harness/_fixture.d.ts +54 -0
- package/dist/__tests__/harness/_fixture.d.ts.map +1 -0
- package/dist/__tests__/harness/_fixture.js +69 -0
- package/dist/__tests__/harness/_fixture.js.map +1 -0
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts +2 -0
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts.map +1 -0
- package/dist/__tests__/harness/codeObject.deploy.test.js +288 -0
- package/dist/__tests__/harness/codeObject.deploy.test.js.map +1 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts +2 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts.map +1 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.js +138 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.js.map +1 -0
- package/dist/__tests__/harness/script.test.d.ts +2 -0
- package/dist/__tests__/harness/script.test.d.ts.map +1 -0
- package/dist/__tests__/harness/script.test.js +219 -0
- package/dist/__tests__/harness/script.test.js.map +1 -0
- package/dist/__tests__/harness/view.test.d.ts +2 -0
- package/dist/__tests__/harness/view.test.d.ts.map +1 -0
- package/dist/__tests__/harness/view.test.js +92 -0
- package/dist/__tests__/harness/view.test.js.map +1 -0
- package/dist/__tests__/runtime.test.d.ts +2 -0
- package/dist/__tests__/runtime.test.d.ts.map +1 -0
- package/dist/__tests__/runtime.test.js +141 -0
- package/dist/__tests__/runtime.test.js.map +1 -0
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/__tests__/compile.test.d.ts +2 -0
- package/dist/commands/__tests__/compile.test.d.ts.map +1 -0
- package/dist/commands/__tests__/compile.test.js +351 -0
- package/dist/commands/__tests__/compile.test.js.map +1 -0
- package/dist/commands/__tests__/init.test.d.ts +2 -0
- package/dist/commands/__tests__/init.test.d.ts.map +1 -0
- package/dist/commands/__tests__/init.test.js +101 -0
- package/dist/commands/__tests__/init.test.js.map +1 -0
- package/dist/commands/__tests__/run.test.d.ts +2 -0
- package/dist/commands/__tests__/run.test.d.ts.map +1 -0
- package/dist/commands/__tests__/run.test.js +166 -0
- package/dist/commands/__tests__/run.test.js.map +1 -0
- package/dist/commands/__tests__/test-move.test.d.ts +2 -0
- package/dist/commands/__tests__/test-move.test.d.ts.map +1 -0
- package/dist/commands/__tests__/test-move.test.js +59 -0
- package/dist/commands/__tests__/test-move.test.js.map +1 -0
- package/dist/commands/__tests__/test.test.d.ts +2 -0
- package/dist/commands/__tests__/test.test.d.ts.map +1 -0
- package/dist/commands/__tests__/test.test.js +168 -0
- package/dist/commands/__tests__/test.test.js.map +1 -0
- package/dist/commands/__tests__/update.test.d.ts +2 -0
- package/dist/commands/__tests__/update.test.d.ts.map +1 -0
- package/dist/commands/__tests__/update.test.js +176 -0
- package/dist/commands/__tests__/update.test.js.map +1 -0
- package/dist/commands/compile.d.ts +7 -1
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +150 -33
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/fork/__tests__/create.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/create.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/create.test.js +108 -0
- package/dist/commands/fork/__tests__/create.test.js.map +1 -0
- package/dist/commands/fork/__tests__/fund.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/fund.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/fund.test.js +72 -0
- package/dist/commands/fork/__tests__/fund.test.js.map +1 -0
- package/dist/commands/fork/__tests__/list.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/list.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/list.test.js +119 -0
- package/dist/commands/fork/__tests__/list.test.js.map +1 -0
- package/dist/commands/fork/__tests__/serve.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/serve.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/serve.test.js +97 -0
- package/dist/commands/fork/__tests__/serve.test.js.map +1 -0
- package/dist/commands/fork/__tests__/view-resource.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/view-resource.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/view-resource.test.js +77 -0
- package/dist/commands/fork/__tests__/view-resource.test.js.map +1 -0
- package/dist/commands/fork/create.d.ts +1 -1
- package/dist/commands/fork/create.d.ts.map +1 -1
- package/dist/commands/fork/create.js +3 -2
- package/dist/commands/fork/create.js.map +1 -1
- package/dist/commands/fork/fund.d.ts.map +1 -1
- package/dist/commands/fork/fund.js +15 -8
- package/dist/commands/fork/fund.js.map +1 -1
- package/dist/commands/fork/list.d.ts.map +1 -1
- package/dist/commands/fork/list.js +2 -1
- package/dist/commands/fork/list.js.map +1 -1
- package/dist/commands/fork/serve.d.ts +1 -0
- package/dist/commands/fork/serve.d.ts.map +1 -1
- package/dist/commands/fork/serve.js +4 -2
- package/dist/commands/fork/serve.js.map +1 -1
- package/dist/commands/fork/view-resource.d.ts.map +1 -1
- package/dist/commands/fork/view-resource.js +10 -5
- package/dist/commands/fork/view-resource.js.map +1 -1
- package/dist/commands/run.d.ts +15 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +50 -27
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/test-move.d.ts.map +1 -1
- package/dist/commands/test-move.js +3 -2
- package/dist/commands/test-move.js.map +1 -1
- package/dist/commands/test.js +52 -46
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +15 -13
- package/dist/commands/update.js.map +1 -1
- package/dist/core/AccountManager.d.ts +1 -1
- package/dist/core/AccountManager.d.ts.map +1 -1
- package/dist/core/AccountManager.js +20 -7
- package/dist/core/AccountManager.js.map +1 -1
- package/dist/core/Publisher.d.ts +31 -0
- package/dist/core/Publisher.d.ts.map +1 -0
- package/dist/core/Publisher.js +248 -0
- package/dist/core/Publisher.js.map +1 -0
- package/dist/core/__tests__/AccountManager.test.d.ts +2 -0
- package/dist/core/__tests__/AccountManager.test.d.ts.map +1 -0
- package/dist/core/__tests__/AccountManager.test.js +239 -0
- package/dist/core/__tests__/AccountManager.test.js.map +1 -0
- package/dist/core/__tests__/config.test.d.ts +2 -0
- package/dist/core/__tests__/config.test.d.ts.map +1 -0
- package/dist/core/__tests__/config.test.js +311 -0
- package/dist/core/__tests__/config.test.js.map +1 -0
- package/dist/core/__tests__/deployments.test.d.ts +2 -0
- package/dist/core/__tests__/deployments.test.d.ts.map +1 -0
- package/dist/core/__tests__/deployments.test.js +201 -0
- package/dist/core/__tests__/deployments.test.js.map +1 -0
- package/dist/core/__tests__/shell.test.d.ts +2 -0
- package/dist/core/__tests__/shell.test.d.ts.map +1 -0
- package/dist/core/__tests__/shell.test.js +107 -0
- package/dist/core/__tests__/shell.test.js.map +1 -0
- package/dist/core/config.d.ts +13 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +80 -11
- package/dist/core/config.js.map +1 -1
- package/dist/core/contract.d.ts +1 -1
- package/dist/core/contract.d.ts.map +1 -1
- package/dist/core/contract.js +15 -4
- package/dist/core/contract.js.map +1 -1
- package/dist/core/deployments.d.ts +2 -2
- package/dist/core/deployments.d.ts.map +1 -1
- package/dist/core/deployments.js +8 -6
- package/dist/core/deployments.js.map +1 -1
- package/dist/core/movementProfile.d.ts +34 -0
- package/dist/core/movementProfile.d.ts.map +1 -0
- package/dist/core/movementProfile.js +150 -0
- package/dist/core/movementProfile.js.map +1 -0
- package/dist/core/shell.d.ts +23 -7
- package/dist/core/shell.d.ts.map +1 -1
- package/dist/core/shell.js +32 -14
- package/dist/core/shell.js.map +1 -1
- package/dist/errors.d.ts +35 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +54 -0
- package/dist/errors.js.map +1 -1
- package/dist/fork/__tests__/manager.test.d.ts +2 -0
- package/dist/fork/__tests__/manager.test.d.ts.map +1 -0
- package/dist/fork/__tests__/manager.test.js +309 -0
- package/dist/fork/__tests__/manager.test.js.map +1 -0
- package/dist/fork/__tests__/server.test.d.ts +2 -0
- package/dist/fork/__tests__/server.test.d.ts.map +1 -0
- package/dist/fork/__tests__/server.test.js +54 -0
- package/dist/fork/__tests__/server.test.js.map +1 -0
- package/dist/fork/__tests__/storage.test.d.ts +2 -0
- package/dist/fork/__tests__/storage.test.d.ts.map +1 -0
- package/dist/fork/__tests__/storage.test.js +222 -0
- package/dist/fork/__tests__/storage.test.js.map +1 -0
- package/dist/fork/__tests__/test.test.d.ts +2 -0
- package/dist/fork/__tests__/test.test.d.ts.map +1 -0
- package/dist/fork/__tests__/test.test.js +81 -0
- package/dist/fork/__tests__/test.test.js.map +1 -0
- package/dist/fork/api.d.ts +14 -3
- package/dist/fork/api.d.ts.map +1 -1
- package/dist/fork/api.js +25 -14
- package/dist/fork/api.js.map +1 -1
- package/dist/fork/manager.d.ts +23 -9
- package/dist/fork/manager.d.ts.map +1 -1
- package/dist/fork/manager.js +79 -36
- package/dist/fork/manager.js.map +1 -1
- package/dist/fork/server.d.ts +11 -3
- package/dist/fork/server.d.ts.map +1 -1
- package/dist/fork/server.js +45 -13
- package/dist/fork/server.js.map +1 -1
- package/dist/fork/storage.d.ts +4 -4
- package/dist/fork/storage.d.ts.map +1 -1
- package/dist/fork/storage.js +7 -9
- package/dist/fork/storage.js.map +1 -1
- package/dist/fork/test.d.ts +13 -4
- package/dist/fork/test.d.ts.map +1 -1
- package/dist/fork/test.js +36 -27
- package/dist/fork/test.js.map +1 -1
- package/dist/harness/Harness.d.ts +124 -0
- package/dist/harness/Harness.d.ts.map +1 -0
- package/dist/harness/Harness.js +193 -0
- package/dist/harness/Harness.js.map +1 -0
- package/dist/harness/codeObject.d.ts +31 -0
- package/dist/harness/codeObject.d.ts.map +1 -0
- package/dist/harness/codeObject.js +271 -0
- package/dist/harness/codeObject.js.map +1 -0
- package/dist/harness/errors.d.ts +14 -0
- package/dist/harness/errors.d.ts.map +1 -0
- package/dist/harness/errors.js +22 -0
- package/dist/harness/errors.js.map +1 -0
- package/dist/harness/index.d.ts +4 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +3 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/proxy.d.ts +7 -0
- package/dist/harness/proxy.d.ts.map +1 -0
- package/dist/harness/proxy.js +36 -0
- package/dist/harness/proxy.js.map +1 -0
- package/dist/harness/script.d.ts +21 -0
- package/dist/harness/script.d.ts.map +1 -0
- package/dist/harness/script.js +155 -0
- package/dist/harness/script.js.map +1 -0
- package/dist/harness/view.d.ts +22 -0
- package/dist/harness/view.d.ts.map +1 -0
- package/dist/harness/view.js +28 -0
- package/dist/harness/view.js.map +1 -0
- package/dist/helpers/__tests__/semver-utils.test.d.ts +2 -0
- package/dist/helpers/__tests__/semver-utils.test.d.ts.map +1 -0
- package/dist/helpers/__tests__/semver-utils.test.js +103 -0
- package/dist/helpers/__tests__/semver-utils.test.js.map +1 -0
- package/dist/helpers/index.d.ts +3 -2
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +2 -2
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/move-tests.d.ts +3 -3
- package/dist/helpers/move-tests.d.ts.map +1 -1
- package/dist/helpers/move-tests.js +21 -20
- package/dist/helpers/move-tests.js.map +1 -1
- package/dist/helpers/npm-registry.d.ts.map +1 -1
- package/dist/helpers/npm-registry.js +1 -3
- package/dist/helpers/npm-registry.js.map +1 -1
- package/dist/helpers/semver-utils.d.ts.map +1 -1
- package/dist/helpers/semver-utils.js +4 -3
- package/dist/helpers/semver-utils.js.map +1 -1
- package/dist/helpers/setup.d.ts.map +1 -1
- package/dist/helpers/setup.js +10 -6
- package/dist/helpers/setup.js.map +1 -1
- package/dist/helpers/setupLocalTesting.d.ts +32 -27
- package/dist/helpers/setupLocalTesting.d.ts.map +1 -1
- package/dist/helpers/setupLocalTesting.js +179 -180
- package/dist/helpers/setupLocalTesting.js.map +1 -1
- package/dist/helpers/testFixtures.d.ts +19 -53
- package/dist/helpers/testFixtures.d.ts.map +1 -1
- package/dist/helpers/testFixtures.js +89 -107
- package/dist/helpers/testFixtures.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/node/LocalNodeManager.d.ts +9 -1
- package/dist/node/LocalNodeManager.d.ts.map +1 -1
- package/dist/node/LocalNodeManager.js +75 -58
- package/dist/node/LocalNodeManager.js.map +1 -1
- package/dist/node/__tests__/LocalNodeManager.test.d.ts +2 -0
- package/dist/node/__tests__/LocalNodeManager.test.d.ts.map +1 -0
- package/dist/node/__tests__/LocalNodeManager.test.js +349 -0
- package/dist/node/__tests__/LocalNodeManager.test.js.map +1 -0
- package/dist/runtime.d.ts +12 -15
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +32 -241
- package/dist/runtime.js.map +1 -1
- package/dist/templates/README.md +1 -1
- package/dist/templates/movehat.config.ts +10 -0
- package/dist/templates/package.json +2 -1
- package/dist/templates/scripts/deploy-counter.ts +46 -38
- package/dist/templates/tests/Counter.test.ts +51 -51
- package/dist/templates/types/movehat.d.ts +6 -9
- package/dist/types/config.d.ts +8 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/fork.d.ts +7 -1
- package/dist/types/fork.d.ts.map +1 -1
- package/dist/types/harness.d.ts +166 -0
- package/dist/types/harness.d.ts.map +1 -0
- package/dist/types/harness.js +2 -0
- package/dist/types/harness.js.map +1 -0
- package/dist/types/runtime.d.ts +7 -1
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/ui/__tests__/colors.test.d.ts +2 -0
- package/dist/ui/__tests__/colors.test.d.ts.map +1 -0
- package/dist/ui/__tests__/colors.test.js +127 -0
- package/dist/ui/__tests__/colors.test.js.map +1 -0
- package/dist/ui/colors.d.ts.map +1 -1
- package/dist/ui/colors.js +6 -2
- package/dist/ui/colors.js.map +1 -1
- package/dist/ui/logger.d.ts +17 -0
- package/dist/ui/logger.d.ts.map +1 -1
- package/dist/ui/logger.js +22 -0
- package/dist/ui/logger.js.map +1 -1
- package/dist/ui/symbols.d.ts +1 -0
- package/dist/ui/symbols.d.ts.map +1 -1
- package/dist/ui/symbols.js +7 -1
- package/dist/ui/symbols.js.map +1 -1
- package/dist/utils/__tests__/address.test.d.ts +2 -0
- package/dist/utils/__tests__/address.test.d.ts.map +1 -0
- package/dist/utils/__tests__/address.test.js +70 -0
- package/dist/utils/__tests__/address.test.js.map +1 -0
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts +2 -0
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts.map +1 -0
- package/dist/utils/__tests__/childProcessAdapter.test.js +217 -0
- package/dist/utils/__tests__/childProcessAdapter.test.js.map +1 -0
- package/dist/utils/__tests__/runCli.test.d.ts +2 -0
- package/dist/utils/__tests__/runCli.test.d.ts.map +1 -0
- package/dist/utils/__tests__/runCli.test.js +187 -0
- package/dist/utils/__tests__/runCli.test.js.map +1 -0
- package/dist/utils/address.d.ts +33 -0
- package/dist/utils/address.d.ts.map +1 -0
- package/dist/utils/address.js +52 -0
- package/dist/utils/address.js.map +1 -0
- package/dist/utils/childProcessAdapter.d.ts +93 -0
- package/dist/utils/childProcessAdapter.d.ts.map +1 -0
- package/dist/utils/childProcessAdapter.js +109 -0
- package/dist/utils/childProcessAdapter.js.map +1 -0
- package/dist/utils/parseCliOutput.d.ts +20 -0
- package/dist/utils/parseCliOutput.d.ts.map +1 -0
- package/dist/utils/parseCliOutput.js +26 -0
- package/dist/utils/parseCliOutput.js.map +1 -0
- package/dist/utils/redact.d.ts +15 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +24 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/runCli.d.ts +24 -0
- package/dist/utils/runCli.d.ts.map +1 -0
- package/dist/utils/runCli.js +37 -0
- package/dist/utils/runCli.js.map +1 -0
- package/package.json +14 -4
- package/src/__tests__/deployContract.test.ts +429 -0
- package/src/__tests__/errors.test.ts +84 -0
- package/src/__tests__/fixtures/sigint-deploy-harness.ts +95 -0
- package/src/__tests__/fork/api.test.ts +143 -0
- package/src/__tests__/harness/Harness.createLive.test.ts +57 -0
- package/src/__tests__/harness/Harness.proxy.test.ts +115 -0
- package/src/__tests__/harness/_fixture.ts +131 -0
- package/src/__tests__/harness/codeObject.deploy.test.ts +319 -0
- package/src/__tests__/harness/codeObject.upgrade.test.ts +156 -0
- package/src/__tests__/harness/script.test.ts +245 -0
- package/src/__tests__/harness/view.test.ts +104 -0
- package/src/__tests__/runtime.test.ts +182 -0
- package/src/cli.ts +2 -1
- package/src/commands/__tests__/compile.test.ts +407 -0
- package/src/commands/__tests__/init.test.ts +125 -0
- package/src/commands/__tests__/run.test.ts +192 -0
- package/src/commands/__tests__/test-move.test.ts +81 -0
- package/src/commands/__tests__/test.test.ts +204 -0
- package/src/commands/__tests__/update.test.ts +223 -0
- package/src/commands/compile.ts +168 -32
- package/src/commands/fork/__tests__/create.test.ts +132 -0
- package/src/commands/fork/__tests__/fund.test.ts +104 -0
- package/src/commands/fork/__tests__/list.test.ts +139 -0
- package/src/commands/fork/__tests__/serve.test.ts +121 -0
- package/src/commands/fork/__tests__/view-resource.test.ts +101 -0
- package/src/commands/fork/create.ts +4 -3
- package/src/commands/fork/fund.ts +16 -9
- package/src/commands/fork/list.ts +3 -2
- package/src/commands/fork/serve.ts +6 -3
- package/src/commands/fork/view-resource.ts +11 -6
- package/src/commands/run.ts +54 -28
- package/src/commands/test-move.ts +4 -3
- package/src/commands/test.ts +56 -44
- package/src/commands/update.ts +19 -16
- package/src/core/AccountManager.ts +23 -10
- package/src/core/Publisher.ts +322 -0
- package/src/core/__tests__/AccountManager.test.ts +290 -0
- package/src/core/__tests__/config.test.ts +377 -0
- package/src/core/__tests__/deployments.test.ts +247 -0
- package/src/core/__tests__/shell.test.ts +138 -0
- package/src/core/config.ts +96 -12
- package/src/core/contract.ts +13 -4
- package/src/core/deployments.ts +13 -11
- package/src/core/movementProfile.ts +179 -0
- package/src/core/shell.ts +34 -14
- package/src/errors.ts +60 -0
- package/src/fork/__tests__/manager.test.ts +385 -0
- package/src/fork/__tests__/server.test.ts +65 -0
- package/src/fork/__tests__/storage.test.ts +281 -0
- package/src/fork/__tests__/test.test.ts +97 -0
- package/src/fork/api.ts +28 -14
- package/src/fork/manager.ts +88 -43
- package/src/fork/server.ts +53 -19
- package/src/fork/storage.ts +12 -15
- package/src/fork/test.ts +58 -32
- package/src/harness/Harness.ts +228 -0
- package/src/harness/codeObject.ts +388 -0
- package/src/harness/errors.ts +22 -0
- package/src/harness/index.ts +3 -0
- package/src/harness/proxy.ts +40 -0
- package/src/harness/script.ts +196 -0
- package/src/harness/view.ts +34 -0
- package/src/helpers/__tests__/semver-utils.test.ts +121 -0
- package/src/helpers/index.ts +2 -8
- package/src/helpers/move-tests.ts +27 -23
- package/src/helpers/npm-registry.ts +4 -3
- package/src/helpers/semver-utils.ts +4 -3
- package/src/helpers/setup.ts +9 -5
- package/src/helpers/setupLocalTesting.ts +219 -200
- package/src/helpers/testFixtures.ts +106 -118
- package/src/index.ts +9 -3
- package/src/node/LocalNodeManager.ts +87 -62
- package/src/node/__tests__/LocalNodeManager.test.ts +452 -0
- package/src/runtime.ts +33 -289
- package/src/templates/README.md +1 -1
- package/src/templates/movehat.config.ts +10 -0
- package/src/templates/package.json +2 -1
- package/src/templates/scripts/deploy-counter.ts +46 -38
- package/src/templates/tests/Counter.test.ts +51 -51
- package/src/templates/types/movehat.d.ts +6 -9
- package/src/types/config.ts +8 -0
- package/src/types/fork.ts +7 -1
- package/src/types/harness.ts +182 -0
- package/src/types/runtime.ts +11 -3
- package/src/ui/__tests__/colors.test.ts +156 -0
- package/src/ui/colors.ts +5 -2
- package/src/ui/logger.ts +22 -0
- package/src/ui/symbols.ts +7 -1
- package/src/utils/__tests__/address.test.ts +93 -0
- package/src/utils/__tests__/childProcessAdapter.test.ts +266 -0
- package/src/utils/__tests__/runCli.test.ts +240 -0
- package/src/utils/address.ts +56 -0
- package/src/utils/childProcessAdapter.ts +215 -0
- package/src/utils/parseCliOutput.ts +27 -0
- package/src/utils/redact.ts +24 -0
- package/src/utils/runCli.ts +64 -0
|
@@ -19,6 +19,15 @@ export interface TestFixture<TModules extends string = string> {
|
|
|
19
19
|
};
|
|
20
20
|
/** Deployed contracts by module name - type-safe based on modules parameter */
|
|
21
21
|
contracts: Record<TModules, MoveContract>;
|
|
22
|
+
/**
|
|
23
|
+
* Stop the local node / fork server this fixture started.
|
|
24
|
+
*
|
|
25
|
+
* Does **not** clear the shared `AccountManager` pool — clearing it
|
|
26
|
+
* would break parallel `setupTestFixture` invocations that share the
|
|
27
|
+
* pool. The pool grows for the lifetime of the process; the process
|
|
28
|
+
* exit reclaims it.
|
|
29
|
+
*/
|
|
30
|
+
teardown: () => Promise<void>;
|
|
22
31
|
}
|
|
23
32
|
/**
|
|
24
33
|
* Setup a complete test fixture with local fork, accounts, and deployed contracts
|
|
@@ -32,84 +41,41 @@ export interface TestFixture<TModules extends string = string> {
|
|
|
32
41
|
* @param modules Array of module names to auto-deploy
|
|
33
42
|
* @param accountLabels Optional array of account labels (defaults to ['alice', 'bob'])
|
|
34
43
|
* @param options Optional LocalTestOptions for advanced configuration
|
|
35
|
-
* @returns TestFixture with runtime, accounts, and
|
|
44
|
+
* @returns TestFixture with runtime, accounts, contracts, and a teardown closure
|
|
36
45
|
*
|
|
37
46
|
* @example
|
|
38
47
|
* ```typescript
|
|
39
|
-
* import { setupTestFixture } from "movehat/helpers";
|
|
48
|
+
* import { setupTestFixture, type TestFixture } from "movehat/helpers";
|
|
40
49
|
*
|
|
41
50
|
* describe("Counter Contract", () => {
|
|
42
|
-
* let fixture: TestFixture
|
|
51
|
+
* let fixture: TestFixture<"counter">;
|
|
43
52
|
*
|
|
44
53
|
* before(async function () {
|
|
45
|
-
* this.timeout(60000);
|
|
46
|
-
*
|
|
47
|
-
* fixture = await setupTestFixture(['counter'], ['alice', 'bob']);
|
|
54
|
+
* this.timeout(60000);
|
|
55
|
+
* fixture = await setupTestFixture(['counter'] as const, ['alice', 'bob']);
|
|
48
56
|
* });
|
|
49
57
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* const value = await counter.view<number>("get", [
|
|
53
|
-
* fixture.accounts.deployer.accountAddress.toString()
|
|
54
|
-
* ]);
|
|
55
|
-
*
|
|
56
|
-
* expect(value).to.equal(0);
|
|
58
|
+
* after(async () => {
|
|
59
|
+
* await fixture.teardown();
|
|
57
60
|
* });
|
|
58
61
|
*
|
|
59
|
-
* it("alice can increment
|
|
62
|
+
* it("alice can increment", async () => {
|
|
60
63
|
* const tx = await fixture.contracts.counter.call(
|
|
61
|
-
* fixture.accounts.alice,
|
|
62
|
-
* "increment",
|
|
63
|
-
* []
|
|
64
|
+
* fixture.accounts.alice, "increment", []
|
|
64
65
|
* );
|
|
65
|
-
*
|
|
66
66
|
* expect(tx.success).to.be.true;
|
|
67
67
|
* });
|
|
68
|
-
*
|
|
69
|
-
* after(async () => {
|
|
70
|
-
* await teardownTestFixture();
|
|
71
|
-
* });
|
|
72
68
|
* });
|
|
73
69
|
* ```
|
|
74
70
|
*/
|
|
75
71
|
export declare function setupTestFixture<TModules extends readonly string[]>(modules: TModules, accountLabels?: string[], options?: Partial<LocalTestOptions>): Promise<TestFixture<TModules[number]>>;
|
|
76
|
-
/**
|
|
77
|
-
* Teardown test fixture and cleanup resources
|
|
78
|
-
*
|
|
79
|
-
* Call this in your test suite's `after` hook to properly cleanup:
|
|
80
|
-
* - Stops fork server
|
|
81
|
-
* - Clears account pool
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```typescript
|
|
85
|
-
* after(async () => {
|
|
86
|
-
* await teardownTestFixture();
|
|
87
|
-
* });
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
export declare function teardownTestFixture(): Promise<void>;
|
|
91
72
|
/**
|
|
92
73
|
* Create a minimal test fixture without auto-deployment
|
|
93
74
|
* Useful when you want to deploy contracts manually in tests
|
|
94
75
|
*
|
|
95
76
|
* @param accountLabels Account labels to create (defaults to ['alice', 'bob'])
|
|
96
77
|
* @param options Optional LocalTestOptions
|
|
97
|
-
* @returns Partial TestFixture (without contracts)
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```typescript
|
|
101
|
-
* let fixture: Partial<TestFixture>;
|
|
102
|
-
*
|
|
103
|
-
* before(async function () {
|
|
104
|
-
* this.timeout(30000);
|
|
105
|
-
* fixture = await setupMinimalFixture(['alice', 'bob', 'charlie']);
|
|
106
|
-
* });
|
|
107
|
-
*
|
|
108
|
-
* it("should deploy contract manually", async () => {
|
|
109
|
-
* await fixture.mh!.deployContract("counter");
|
|
110
|
-
* // ...
|
|
111
|
-
* });
|
|
112
|
-
* ```
|
|
78
|
+
* @returns Partial TestFixture (without contracts) plus a teardown closure
|
|
113
79
|
*/
|
|
114
80
|
export declare function setupMinimalFixture(accountLabels?: string[], options?: Partial<LocalTestOptions>): Promise<Omit<TestFixture, "contracts">>;
|
|
115
81
|
//# sourceMappingURL=testFixtures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFixtures.d.ts","sourceRoot":"","sources":["../../src/helpers/testFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"testFixtures.d.ts","sourceRoot":"","sources":["../../src/helpers/testFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,WAAW,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IAC3D,+BAA+B;IAC/B,EAAE,EAAE,cAAc,CAAC;IAEnB,kDAAkD;IAClD,QAAQ,EAAE;QACR,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,OAAO,CAAC;QACf,GAAG,EAAE,OAAO,CAAC;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IAEF,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAE1C;;;;;;;OAOG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,SAAS,SAAS,MAAM,EAAE,EACvE,OAAO,EAAE,QAAQ,EACjB,aAAa,GAAE,MAAM,EAAqB,EAC1C,OAAO,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACtC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAuExC;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,aAAa,GAAE,MAAM,EAAqB,EAC1C,OAAO,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACtC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CA2CzC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AccountManager } from "../core/AccountManager.js";
|
|
2
|
-
import { setupLocalTesting
|
|
2
|
+
import { setupLocalTesting } from "./setupLocalTesting.js";
|
|
3
|
+
import { logger } from "../ui/index.js";
|
|
3
4
|
/**
|
|
4
5
|
* Setup a complete test fixture with local fork, accounts, and deployed contracts
|
|
5
6
|
*
|
|
@@ -12,108 +13,90 @@ import { setupLocalTesting, stopLocalTesting } from "./setupLocalTesting.js";
|
|
|
12
13
|
* @param modules Array of module names to auto-deploy
|
|
13
14
|
* @param accountLabels Optional array of account labels (defaults to ['alice', 'bob'])
|
|
14
15
|
* @param options Optional LocalTestOptions for advanced configuration
|
|
15
|
-
* @returns TestFixture with runtime, accounts, and
|
|
16
|
+
* @returns TestFixture with runtime, accounts, contracts, and a teardown closure
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* ```typescript
|
|
19
|
-
* import { setupTestFixture } from "movehat/helpers";
|
|
20
|
+
* import { setupTestFixture, type TestFixture } from "movehat/helpers";
|
|
20
21
|
*
|
|
21
22
|
* describe("Counter Contract", () => {
|
|
22
|
-
* let fixture: TestFixture
|
|
23
|
+
* let fixture: TestFixture<"counter">;
|
|
23
24
|
*
|
|
24
25
|
* before(async function () {
|
|
25
|
-
* this.timeout(60000);
|
|
26
|
-
*
|
|
27
|
-
* fixture = await setupTestFixture(['counter'], ['alice', 'bob']);
|
|
26
|
+
* this.timeout(60000);
|
|
27
|
+
* fixture = await setupTestFixture(['counter'] as const, ['alice', 'bob']);
|
|
28
28
|
* });
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* const value = await counter.view<number>("get", [
|
|
33
|
-
* fixture.accounts.deployer.accountAddress.toString()
|
|
34
|
-
* ]);
|
|
35
|
-
*
|
|
36
|
-
* expect(value).to.equal(0);
|
|
30
|
+
* after(async () => {
|
|
31
|
+
* await fixture.teardown();
|
|
37
32
|
* });
|
|
38
33
|
*
|
|
39
|
-
* it("alice can increment
|
|
34
|
+
* it("alice can increment", async () => {
|
|
40
35
|
* const tx = await fixture.contracts.counter.call(
|
|
41
|
-
* fixture.accounts.alice,
|
|
42
|
-
* "increment",
|
|
43
|
-
* []
|
|
36
|
+
* fixture.accounts.alice, "increment", []
|
|
44
37
|
* );
|
|
45
|
-
*
|
|
46
38
|
* expect(tx.success).to.be.true;
|
|
47
39
|
* });
|
|
48
|
-
*
|
|
49
|
-
* after(async () => {
|
|
50
|
-
* await teardownTestFixture();
|
|
51
|
-
* });
|
|
52
40
|
* });
|
|
53
41
|
* ```
|
|
54
42
|
*/
|
|
55
43
|
export async function setupTestFixture(modules, accountLabels = ["alice", "bob"], options = {}) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
logger.newline();
|
|
45
|
+
logger.step("Setting up test fixture...");
|
|
46
|
+
logger.plain(` Modules to deploy: ${modules.join(", ")}`);
|
|
47
|
+
logger.plain(` Account labels: deployer, ${accountLabels.join(", ")}`);
|
|
48
|
+
logger.newline();
|
|
60
49
|
const allLabels = ["deployer", ...accountLabels.filter((l) => l !== "deployer")];
|
|
61
|
-
// Setup local testing environment with auto-deploy
|
|
62
50
|
const setupOptions = {
|
|
63
51
|
...options,
|
|
64
52
|
accountLabels: allLabels,
|
|
65
|
-
autoDeploy: modules,
|
|
53
|
+
autoDeploy: modules,
|
|
66
54
|
};
|
|
67
|
-
const
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
55
|
+
const ctx = await setupLocalTesting(setupOptions);
|
|
56
|
+
// Assembly is fallible — a missing deployment address (autoDeploy
|
|
57
|
+
// silently failed) or any unexpected throw would leak the started
|
|
58
|
+
// infrastructure. Tear down ctx on failure; the outer caller sees
|
|
59
|
+
// the original assembly error unchanged.
|
|
60
|
+
try {
|
|
61
|
+
const mh = ctx.runtime;
|
|
62
|
+
const labeledAccounts = AccountManager.getLabeledAccounts();
|
|
63
|
+
// any: TestFixture.accounts has a structural shape with required
|
|
64
|
+
// `deployer/alice/bob` plus a `[key: string]: Account` index. The
|
|
65
|
+
// builder fills the index dynamically; typing this as the exact
|
|
66
|
+
// intersection would require a generic over `accountLabels` and
|
|
67
|
+
// produce noisy errors for the dynamic key assignment below.
|
|
68
|
+
const accounts = {
|
|
69
|
+
// non-null: setupLocalTesting → setupWithLocalNode/Fork unconditionally
|
|
70
|
+
// funds the deployer account via accountLabels[0]; deployer is always
|
|
71
|
+
// first by construction at L93 above.
|
|
72
|
+
deployer: labeledAccounts.deployer,
|
|
73
|
+
};
|
|
74
|
+
for (const label of accountLabels) {
|
|
75
|
+
accounts[label] = labeledAccounts[label] || AccountManager.getOrCreateLabeled(label);
|
|
85
76
|
}
|
|
86
|
-
contracts
|
|
87
|
-
|
|
77
|
+
const contracts = {};
|
|
78
|
+
for (const moduleName of modules) {
|
|
79
|
+
const deploymentAddress = mh.getDeploymentAddress(moduleName);
|
|
80
|
+
if (!deploymentAddress) {
|
|
81
|
+
throw new Error(`Module "${moduleName}" was not deployed. Check auto-deploy logs.`);
|
|
82
|
+
}
|
|
83
|
+
contracts[moduleName] = mh.getContract(deploymentAddress, moduleName);
|
|
84
|
+
logger.success(`Contract "${moduleName}" ready at ${deploymentAddress}`, 2);
|
|
85
|
+
}
|
|
86
|
+
logger.newline();
|
|
87
|
+
logger.success("Test fixture ready!");
|
|
88
|
+
logger.newline();
|
|
89
|
+
return {
|
|
90
|
+
mh,
|
|
91
|
+
accounts,
|
|
92
|
+
contracts,
|
|
93
|
+
teardown: ctx.teardown,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
await ctx.teardown().catch(() => { });
|
|
98
|
+
throw error;
|
|
88
99
|
}
|
|
89
|
-
console.log(`\n✅ Test fixture ready!\n`);
|
|
90
|
-
return {
|
|
91
|
-
mh,
|
|
92
|
-
accounts,
|
|
93
|
-
contracts,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Teardown test fixture and cleanup resources
|
|
98
|
-
*
|
|
99
|
-
* Call this in your test suite's `after` hook to properly cleanup:
|
|
100
|
-
* - Stops fork server
|
|
101
|
-
* - Clears account pool
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```typescript
|
|
105
|
-
* after(async () => {
|
|
106
|
-
* await teardownTestFixture();
|
|
107
|
-
* });
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
export async function teardownTestFixture() {
|
|
111
|
-
console.log(`\n🧹 Tearing down test fixture...`);
|
|
112
|
-
// Stop fork server
|
|
113
|
-
await stopLocalTesting();
|
|
114
|
-
// Clear account pool for test isolation
|
|
115
|
-
AccountManager.clearPool();
|
|
116
|
-
console.log(`✓ Teardown complete\n`);
|
|
117
100
|
}
|
|
118
101
|
/**
|
|
119
102
|
* Create a minimal test fixture without auto-deployment
|
|
@@ -121,43 +104,42 @@ export async function teardownTestFixture() {
|
|
|
121
104
|
*
|
|
122
105
|
* @param accountLabels Account labels to create (defaults to ['alice', 'bob'])
|
|
123
106
|
* @param options Optional LocalTestOptions
|
|
124
|
-
* @returns Partial TestFixture (without contracts)
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```typescript
|
|
128
|
-
* let fixture: Partial<TestFixture>;
|
|
129
|
-
*
|
|
130
|
-
* before(async function () {
|
|
131
|
-
* this.timeout(30000);
|
|
132
|
-
* fixture = await setupMinimalFixture(['alice', 'bob', 'charlie']);
|
|
133
|
-
* });
|
|
134
|
-
*
|
|
135
|
-
* it("should deploy contract manually", async () => {
|
|
136
|
-
* await fixture.mh!.deployContract("counter");
|
|
137
|
-
* // ...
|
|
138
|
-
* });
|
|
139
|
-
* ```
|
|
107
|
+
* @returns Partial TestFixture (without contracts) plus a teardown closure
|
|
140
108
|
*/
|
|
141
109
|
export async function setupMinimalFixture(accountLabels = ["alice", "bob"], options = {}) {
|
|
142
|
-
|
|
110
|
+
logger.newline();
|
|
111
|
+
logger.step("Setting up minimal test fixture (no auto-deploy)...");
|
|
143
112
|
const allLabels = ["deployer", ...accountLabels.filter((l) => l !== "deployer")];
|
|
144
113
|
const setupOptions = {
|
|
145
114
|
...options,
|
|
146
115
|
accountLabels: allLabels,
|
|
147
|
-
autoDeploy: [],
|
|
116
|
+
autoDeploy: [],
|
|
148
117
|
};
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
accounts
|
|
118
|
+
const ctx = await setupLocalTesting(setupOptions);
|
|
119
|
+
// Same teardown-on-assembly-failure pattern as setupTestFixture.
|
|
120
|
+
try {
|
|
121
|
+
const mh = ctx.runtime;
|
|
122
|
+
const labeledAccounts = AccountManager.getLabeledAccounts();
|
|
123
|
+
// any: see setupTestFixture above — same dynamic-key builder pattern.
|
|
124
|
+
const accounts = {
|
|
125
|
+
// non-null: deployer is unconditionally added to allLabels at L156 above.
|
|
126
|
+
deployer: labeledAccounts.deployer,
|
|
127
|
+
};
|
|
128
|
+
for (const label of accountLabels) {
|
|
129
|
+
accounts[label] = labeledAccounts[label] || AccountManager.getOrCreateLabeled(label);
|
|
130
|
+
}
|
|
131
|
+
logger.newline();
|
|
132
|
+
logger.success("Minimal fixture ready!");
|
|
133
|
+
logger.newline();
|
|
134
|
+
return {
|
|
135
|
+
mh,
|
|
136
|
+
accounts,
|
|
137
|
+
teardown: ctx.teardown,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
await ctx.teardown().catch(() => { });
|
|
142
|
+
throw error;
|
|
156
143
|
}
|
|
157
|
-
console.log(`\n✅ Minimal fixture ready!\n`);
|
|
158
|
-
return {
|
|
159
|
-
mh,
|
|
160
|
-
accounts,
|
|
161
|
-
};
|
|
162
144
|
}
|
|
163
145
|
//# sourceMappingURL=testFixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFixtures.js","sourceRoot":"","sources":["../../src/helpers/testFixtures.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"testFixtures.js","sourceRoot":"","sources":["../../src/helpers/testFixtures.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export * from "./helpers/index.js";
|
|
2
2
|
export type { MovehatConfig } from "./types/config.js";
|
|
3
|
-
export { initRuntime
|
|
3
|
+
export { initRuntime } from "./runtime.js";
|
|
4
4
|
export type { MovehatRuntime, NetworkInfo } from "./types/runtime.js";
|
|
5
5
|
export { ForkManager } from "./fork/manager.js";
|
|
6
6
|
export { MovementApiClient } from "./fork/api.js";
|
|
7
7
|
export { ForkStorage } from "./fork/storage.js";
|
|
8
8
|
export { ForkServer } from "./fork/server.js";
|
|
9
9
|
export type { ForkMetadata, AccountState, LedgerInfo, AccountData, AccountResource } from "./types/fork.js";
|
|
10
|
-
export { ModuleAlreadyDeployedError } from "./errors.js";
|
|
10
|
+
export { ModuleAlreadyDeployedError, PostPublishError } from "./errors.js";
|
|
11
|
+
export { Harness, HarnessDisposedError } from "./harness/index.js";
|
|
12
|
+
export type { HarnessMode } from "./harness/index.js";
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAG5G,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG3E,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// Export all helpers for end users
|
|
2
2
|
export * from "./helpers/index.js";
|
|
3
|
-
//
|
|
4
|
-
|
|
3
|
+
// Movehat Runtime Environment. `initRuntime` is a public utility but
|
|
4
|
+
// external callers should prefer Harness; it's the construction primitive
|
|
5
|
+
// `Harness.createLive` uses.
|
|
6
|
+
export { initRuntime } from "./runtime.js";
|
|
5
7
|
// Export Fork system
|
|
6
8
|
export { ForkManager } from "./fork/manager.js";
|
|
7
9
|
export { MovementApiClient } from "./fork/api.js";
|
|
8
10
|
export { ForkStorage } from "./fork/storage.js";
|
|
9
11
|
export { ForkServer } from "./fork/server.js";
|
|
10
12
|
// Export custom errors
|
|
11
|
-
export { ModuleAlreadyDeployedError } from "./errors.js";
|
|
13
|
+
export { ModuleAlreadyDeployedError, PostPublishError } from "./errors.js";
|
|
14
|
+
// Export Harness (Hardhat-style API — primary public surface from M2 onward)
|
|
15
|
+
export { Harness, HarnessDisposedError } from "./harness/index.js";
|
|
12
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,cAAc,oBAAoB,CAAC;AAGnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,cAAc,oBAAoB,CAAC;AAGnC,qEAAqE;AACrE,0EAA0E;AAC1E,6BAA6B;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,qBAAqB;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,uBAAuB;AACvB,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE3E,6EAA6E;AAC7E,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Account } from "@aptos-labs/ts-sdk";
|
|
2
|
+
import { type ChildProcessAdapter } from "../utils/childProcessAdapter.js";
|
|
2
3
|
export interface LocalNodeOptions {
|
|
3
4
|
testDir?: string;
|
|
4
5
|
forceRestart?: boolean;
|
|
@@ -6,6 +7,11 @@ export interface LocalNodeOptions {
|
|
|
6
7
|
apiPort?: number;
|
|
7
8
|
readyPort?: number;
|
|
8
9
|
silent?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Override the child-process adapter. Tests inject a fake adapter so
|
|
12
|
+
* the daemon spawn never reaches the real `movement` binary.
|
|
13
|
+
*/
|
|
14
|
+
adapter?: ChildProcessAdapter;
|
|
9
15
|
}
|
|
10
16
|
export interface LocalNodeInfo {
|
|
11
17
|
rpcUrl: string;
|
|
@@ -23,8 +29,10 @@ export interface LocalNodeInfo {
|
|
|
23
29
|
* - Cleanup on shutdown
|
|
24
30
|
*/
|
|
25
31
|
export declare class LocalNodeManager {
|
|
26
|
-
private
|
|
32
|
+
private spawned;
|
|
33
|
+
private killed;
|
|
27
34
|
private options;
|
|
35
|
+
private readonly adapter;
|
|
28
36
|
private starting;
|
|
29
37
|
constructor(options?: LocalNodeOptions);
|
|
30
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalNodeManager.d.ts","sourceRoot":"","sources":["../../src/node/LocalNodeManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalNodeManager.d.ts","sourceRoot":"","sources":["../../src/node/LocalNodeManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAC;AAGzC,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAA8C;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAkB;gBAEtB,OAAO,GAAE,gBAAqB;IAY1C;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,aAAa,CAAC;IAqGrC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAqC3B;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,WAAW,IAAI,aAAa;IAS5B;;OAEG;YACW,YAAY;IA0B1B;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,MAAM,GAAE,MAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCzF;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAE,MAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/F;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAW7B"}
|