@@ -30,6 +30,48 @@ function absBuildDir(fixture: string, dir = "dist"): string {
3030 return resolve ( fixture , dir ) ;
3131}
3232
33+ /**
34+ * Shared helper for contract-deploy end-to-end tests.
35+ *
36+ * `--no-contract-build` skips the toolchain subprocess (forge / npx hardhat
37+ * compile / cargo-contract) so the CI runner doesn't need the EVM/Rust
38+ * toolchain installed. Each fixture ships pre-built bytecode in its out/ or
39+ * artifacts/ directory.
40+ */
41+ interface ContractDeployTestConfig {
42+ /** describe-block discriminator: "foundry", "hardhat", "multi" */
43+ name : string ;
44+ /** E2E_DOMAINS.<name> */
45+ domain : string ;
46+ /** fixturePath() result */
47+ fixture : string ;
48+ }
49+
50+ function runContractDeployTest ( cfg : ContractDeployTestConfig ) : void {
51+ describe ( `dot deploy — ${ cfg . name } (requires Paseo + IPFS)` , ( ) => {
52+ test ( `${ cfg . name } deploy completes end-to-end` , { timeout : 450_000 } , async ( ) => {
53+ const result = await dot ( [
54+ "deploy" ,
55+ "--signer" , "dev" ,
56+ "--domain" , cfg . domain ,
57+ "--buildDir" , absBuildDir ( cfg . fixture ) ,
58+ "--contracts" ,
59+ "--no-contract-build" ,
60+ "--playground" ,
61+ "--suri" , SIGNER . suri ,
62+ "--dir" , cfg . fixture ,
63+ ] , { timeout : 400_000 } ) ;
64+
65+ expect (
66+ result . exitCode ,
67+ `${ cfg . name } deploy failed: ${ result . stdout } \n${ result . stderr } ` ,
68+ ) . toBe ( 0 ) ;
69+ expect ( result . stdout ) . toContain ( "Deploy complete" ) ;
70+ expect ( result . stdout ) . toContain ( cfg . domain ) ;
71+ } ) ;
72+ } ) ;
73+ }
74+
3375describe ( "dot deploy — preflight and validation" , ( ) => {
3476 test ( "reports mainnet not yet supported" , async ( ) => {
3577 const result = await dot ( [
@@ -238,61 +280,12 @@ describe("dot deploy --playground — full pipeline (requires Paseo + IPFS)", ()
238280 } ) ;
239281} ) ;
240282
241- describe ( "dot deploy — foundry (requires Paseo + IPFS)" , ( ) => {
242- test ( "foundry deploy completes end-to-end" , { timeout : 450_000 } , async ( ) => {
243- const domain = E2E_DOMAINS . foundry ;
244- const result = await dot ( [
245- "deploy" ,
246- "--signer" , "dev" ,
247- "--domain" , domain ,
248- "--buildDir" , absBuildDir ( foundry ) ,
249- // --no-contract-build skips the forge subprocess so we don't
250- // need the EVM toolchain on the CI runner; the fixture ships
251- // pre-committed bytecode under out/Counter.sol/Counter.json.
252- // The frontend build is the trivial mkdir+echo in the fixture's
253- // package.json — let it run to produce dist/.
254- "--contracts" ,
255- "--no-contract-build" ,
256- "--playground" ,
257- "--suri" , SIGNER . suri ,
258- "--dir" , foundry ,
259- ] , { timeout : 400_000 } ) ;
260-
261- expect (
262- result . exitCode ,
263- `foundry deploy failed: ${ result . stdout } \n${ result . stderr } ` ,
264- ) . toBe ( 0 ) ;
265- expect ( result . stdout ) . toContain ( "Deploy complete" ) ;
266- expect ( result . stdout ) . toContain ( domain ) ;
267- } ) ;
268- } ) ;
269-
270- describe ( "dot deploy — hardhat (requires Paseo + IPFS)" , ( ) => {
271- test ( "hardhat deploy completes end-to-end" , { timeout : 450_000 } , async ( ) => {
272- const domain = E2E_DOMAINS . hardhat ;
273- const result = await dot ( [
274- "deploy" ,
275- "--signer" , "dev" ,
276- "--domain" , domain ,
277- "--buildDir" , absBuildDir ( hardhat ) ,
278- // --no-contract-build skips `npx hardhat compile` (the toolchain
279- // isn't installed on the CI runner). The fixture ships pre-built
280- // bytecode under artifacts/contracts/Lock.sol/Lock.json.
281- "--contracts" ,
282- "--no-contract-build" ,
283- "--playground" ,
284- "--suri" , SIGNER . suri ,
285- "--dir" , hardhat ,
286- ] , { timeout : 400_000 } ) ;
287-
288- expect (
289- result . exitCode ,
290- `hardhat deploy failed: ${ result . stdout } \n${ result . stderr } ` ,
291- ) . toBe ( 0 ) ;
292- expect ( result . stdout ) . toContain ( "Deploy complete" ) ;
293- expect ( result . stdout ) . toContain ( domain ) ;
294- } ) ;
295- } ) ;
283+ // Contract-deploy tests — parametrized via runContractDeployTest
284+ runContractDeployTest ( { name : "foundry" , domain : E2E_DOMAINS . foundry , fixture : foundry } ) ;
285+ runContractDeployTest ( { name : "hardhat" , domain : E2E_DOMAINS . hardhat , fixture : hardhat } ) ;
286+ // Multi-contract foundry project — exercises the contracts-batch publish path
287+ // (TokenA.sol + TokenB.sol deployed in a single --contracts run).
288+ runContractDeployTest ( { name : "multi" , domain : E2E_DOMAINS . multi , fixture : multiContract } ) ;
296289
297290// SKIPPED: the rust-cdm fixture's `target/flipper.contract` is a stub
298291// (`{"source":{"hash":"0xabc"}}`) and there is no `target/<crate>.release.polkavm`
0 commit comments