Commit 971666c
authored
test: compact-deployer examples and integration suite (#109)
* test(deployer): add examples and integration-test suite
Add the fungible-token deploy walkthrough under examples/ and the
end-to-end integration suite under tests/integrations/, both built on
the compact-deployer tool.
* examples/fungible-token: a TokenExample contract wrapping the OZ
Compact FungibleToken module, with deploy scripts exercising the
common constructor-arg types and `compact-deploy` CLI invocations.
* tests/integrations: vitest specs covering deploy flows, dry-run,
history isolation/rotation, wallet lifecycle, keystore and error
paths, plus a docker local-stack harness driven by the top-level
Makefile.
* Re-add the `examples/*` workspace and the integration/env make
shortcuts to the root package.json, and the root compact.toml used
for real-network deploys.
Both source trees are compiled with `compact compile +0.31.1`, the
compiler that matches the deployer's pinned compact-runtime 0.16.0.
An artifact from the default compactc fails at submit with a version
mismatch, so the version is a Makefile variable rather than implicit.
The root `types` script now also runs tsc over tests/integrations.
That tree is not a workspace package, so nothing else would type-check
it, and vitest only strips its types.
The two specs that need `proof_server = "auto"` are skipped: testkit-js
boots that container from a `proof-server.yml` in the process CWD,
which this repo does not ship.
Part 2 of 2 splitting the original deployer PR.
Refs: #86
* fix(tests): address CodeRabbit review feedback
* integrations/walletPool: evict a wallet build from the cache if it
rejects, so a failed `WalletHandler.build`/`provider.start` no longer
poisons every later `signerFor(alias)` call with the same rejection.
* integrations/local-env: pin proof-server and indexer-standalone to
release tags (8.0.3 and 4.0.1) rather than `:latest`, so the stack
matches the ledger-v8 versions the deployer supports and does not
move under the suite. Drop the proof-server container healthcheck
too: that image is distroless, so no probe can run in it and the
container never reports healthy. `make env-up` polls /version from
the host instead.
Refs: #86
* fix(examples): point testnet proof_server at localhost
"auto" boots a testkit container from a proof-server.yml in the
working directory; nothing in this repo ships one, so the preview and
preprod blocks could never resolve a proof server.
* test(integrations): assert the seeded private state
The PrivateCounter spec inferred both deploy-pipeline paths from a
green result. It now owns the private-state provider and reads the
seed back, and asserts whole shapes instead of probing fields.
* docs(examples): name the vendored compact-contracts commit
The three vendored modules claimed v0.0.1-alpha.1; they are
byte-identical to compact-contracts 19b36a74. The header now names the
commit so a refresh has a diff base, and TokenExample drops the unused
Maybe export.
* docs(examples): link the CLI flag list, drop sync timing
The preview timing contradicted the null-route callout two lines
below, and the hand-copied flag list was a second source of truth for
the deployer README's.
* refactor(integrations): one source for stack + seeds
The MIDNIGHT_* overrides could point pool wallets at a different stack
than the one compact.toml deploys against, and the seed table restated
the deployer's LOCAL_PREFUNDED_SEEDS. Aliases now index into that
export, and getSharedPool() drops the env argument it ignored after the
first call.
* test(integrations): assert error text, keep the pool warm
walletPool.spec reset the shared pool in afterAll, forcing every later
spec to re-sync its wallets; it now owns a pool. The error specs
promised messages naming the offending key and asserted only the class.
* build: make types and test-integration self-sufficient
Both needed packages/deployer/dist to exist already. `types` now runs
the build task first and `test-integration` takes build as a
prerequisite. The Ctrl+C teardown ran twice because the EXIT handler
fires after the INT one; trap EXIT alone. @tsconfig/node24 pinned exact
like the other root dev deps.
* chore: drop the root compact.toml
Nothing consumed it: the integration suite and the example each carry
their own config. Its `signing_key_file` pointed at a gitignored path
that does not exist, and because `CompactConfig.load()` walks upward it
silently became the config for any bare `compact-deploy` run inside
`packages/*`.
* test(integrations): un-skip the proof-server specs
The `auto` path works now that the deployer ships its compose file, so
both specs run against a real container instead of being skipped. Each
asserts that no `proof-server_*` container is left running: the
containers take a random host port, so a leak collides with nothing and
a later deploy succeeding proves nothing about cleanup on its own.
That assertion is also why the async-dispose spec no longer redeploys.
As the suite's first transaction on a fresh chain, that deploy failed on
dust the genesis wallet had not accrued yet.
The example's testnet blocks go back to `"auto"`, so nothing there needs
a proof server started by hand.
* docs(integrations): correct the proof-server healthcheck note
The image has a shell; it only lacks curl. Say that instead of
calling it distroless.
* docs(examples): say the vendored modules carry local headers
* build: recompile fixtures when the compiler pin changes
The artifact targets only depended on their .compact sources, so a
COMPACTC_VERSION bump kept artifacts from the previous compiler.
* test(integrations): assert prepare leaves an injected wallet unstarted
* fix(integrations): await the deploy inside the await-using scope
Returning the bare promise let Deployer's asyncDispose run before the
deploy settled, tearing down the wallet and any auto proof-server
container while proving was still in flight.
* fix(integrations): publish the local stack on loopback only
Every consumer targets 127.0.0.1, so binding on 0.0.0.0 only exposed
the dev node and the insecure-credential indexer to the LAN.
* build: make clean drop fixture artifacts and logs1 parent 66d6f5f commit 971666c
44 files changed
Lines changed: 2841 additions & 4 deletions
File tree
- examples
- fungible-token
- contracts
- security
- token
- utils
- deploy
- tests/integrations
- _harness
- fixtures
- initstates
- signingkeys
- witnesses
- specs
- deploy
- errors
- wallet
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
0 commit comments