diff --git a/.github/workflows/arbitrator-ci.yml b/.github/workflows/arbitrator-ci.yml index 8b271e4dbc..96e0790430 100644 --- a/.github/workflows/arbitrator-ci.yml +++ b/.github/workflows/arbitrator-ci.yml @@ -152,4 +152,4 @@ jobs: cd solgen yarn install yarn build - yarn hardhat --network localhost test test/geth/*.ts \ No newline at end of file + yarn hardhat --network localhost test test/prover/*.ts \ No newline at end of file diff --git a/.github/workflows/contract-tests.yml b/.github/workflows/contract-tests.yml index a727ac7a91..c93379b424 100644 --- a/.github/workflows/contract-tests.yml +++ b/.github/workflows/contract-tests.yml @@ -28,4 +28,4 @@ jobs: cd solgen yarn install yarn build - yarn hardhat --network hardhat test test/hardhat/*.spec.ts + yarn hardhat --network hardhat test test/contract/*.spec.ts diff --git a/.gitignore b/.gitignore index 23230ff41d..b34359abf4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ solgen/cache/ solgen/go/ solgen/node_modules/ solgen/deployments/ -solgen/test/geth/proofs/*.json +solgen/test/prover/proofs/*.json .make/ /cmd/statetransfer/statetransfer /reproducible-wasm/*.wasm diff --git a/Makefile b/Makefile index 3ce07dddac..fc405a7787 100644 --- a/Makefile +++ b/Makefile @@ -80,9 +80,9 @@ test-go-challenge: test-go-deps @printf $(done) test-gen-proofs: \ - $(patsubst arbitrator/prover/test-cases/%.wat,solgen/test/geth/proofs/%.json, $(arbitrator_tests_wat)) \ - $(patsubst arbitrator/prover/test-cases/rust/src/bin/%.rs,solgen/test/geth/proofs/rust-%.json, $(arbitrator_tests_rust)) \ - solgen/test/geth/proofs/go.json + $(patsubst arbitrator/prover/test-cases/%.wat,solgen/test/prover/proofs/%.json, $(arbitrator_tests_wat)) \ + $(patsubst arbitrator/prover/test-cases/rust/src/bin/%.rs,solgen/test/prover/proofs/rust-%.json, $(arbitrator_tests_rust)) \ + solgen/test/prover/proofs/go.json wasm-ci-build: $(arbitrator_wasm_libs) $(arbitrator_test_wasms) @printf $(done) @@ -93,7 +93,7 @@ clean: rm -f arbitrator/prover/test-cases/*.wasm rm -f arbitrator/prover/test-cases/go/main rm -rf $(output_root) - rm -f solgen/test/geth/proofs/*.json + rm -f solgen/test/prover/proofs/*.json rm -rf arbitrator/target rm -rf arbitrator/wasm-libraries/target rm -f arbitrator/wasm-libraries/soft-float/soft-float.wasm @@ -235,16 +235,16 @@ $(output_root)/lib/host_io.wasm: arbitrator/wasm-libraries/host-io/src/** arbitrator/prover/test-cases/%.wasm: arbitrator/prover/test-cases/%.wat wat2wasm $< -o $@ -solgen/test/geth/proofs/%.json: arbitrator/prover/test-cases/%.wasm $(arbitrator_prover_bin) +solgen/test/prover/proofs/%.json: arbitrator/prover/test-cases/%.wasm $(arbitrator_prover_bin) $(arbitrator_prover_bin) $< -o $@ --allow-hostapi --always-merkleize -solgen/test/geth/proofs/float%.json: arbitrator/prover/test-cases/float%.wasm $(arbitrator_prover_bin) $(output_root)/lib/soft-float.wasm +solgen/test/prover/proofs/float%.json: arbitrator/prover/test-cases/float%.wasm $(arbitrator_prover_bin) $(output_root)/lib/soft-float.wasm $(arbitrator_prover_bin) $< -l $(output_root)/lib/soft-float.wasm -o $@ -b --allow-hostapi --require-success --always-merkleize -solgen/test/geth/proofs/rust-%.json: arbitrator/prover/test-cases/rust/target/wasm32-wasi/release/%.wasm $(arbitrator_prover_bin) $(arbitrator_wasm_libs_nogo) +solgen/test/prover/proofs/rust-%.json: arbitrator/prover/test-cases/rust/target/wasm32-wasi/release/%.wasm $(arbitrator_prover_bin) $(arbitrator_wasm_libs_nogo) $(arbitrator_prover_bin) $< $(arbitrator_wasm_lib_flags_nogo) -o $@ -b --allow-hostapi --require-success --inbox-add-stub-headers --inbox arbitrator/prover/test-cases/rust/data/msg0.bin --inbox arbitrator/prover/test-cases/rust/data/msg1.bin --delayed-inbox arbitrator/prover/test-cases/rust/data/msg0.bin --delayed-inbox arbitrator/prover/test-cases/rust/data/msg1.bin --preimages arbitrator/prover/test-cases/rust/data/preimages.bin -solgen/test/geth/proofs/go.json: arbitrator/prover/test-cases/go/main $(arbitrator_prover_bin) $(arbitrator_wasm_libs) +solgen/test/prover/proofs/go.json: arbitrator/prover/test-cases/go/main $(arbitrator_prover_bin) $(arbitrator_wasm_libs) $(arbitrator_prover_bin) $< $(arbitrator_wasm_lib_flags) -o $@ -i 5000000 # strategic rules to minimize dependency building diff --git a/solgen/test/hardhat/arbRollup.spec.ts b/solgen/test/contract/arbRollup.spec.ts similarity index 100% rename from solgen/test/hardhat/arbRollup.spec.ts rename to solgen/test/contract/arbRollup.spec.ts diff --git a/solgen/test/hardhat/common/challengeLib.ts b/solgen/test/contract/common/challengeLib.ts similarity index 100% rename from solgen/test/hardhat/common/challengeLib.ts rename to solgen/test/contract/common/challengeLib.ts diff --git a/solgen/test/hardhat/common/globalStateLib.ts b/solgen/test/contract/common/globalStateLib.ts similarity index 100% rename from solgen/test/hardhat/common/globalStateLib.ts rename to solgen/test/contract/common/globalStateLib.ts diff --git a/solgen/test/hardhat/common/rolluplib.ts b/solgen/test/contract/common/rolluplib.ts similarity index 100% rename from solgen/test/hardhat/common/rolluplib.ts rename to solgen/test/contract/common/rolluplib.ts diff --git a/solgen/test/hardhat/cryptographyPrimitives.spec.ts b/solgen/test/contract/cryptographyPrimitives.spec.ts similarity index 100% rename from solgen/test/hardhat/cryptographyPrimitives.spec.ts rename to solgen/test/contract/cryptographyPrimitives.spec.ts diff --git a/solgen/test/hardhat/sequencerInbox.spec.ts b/solgen/test/contract/sequencerInboxForceInclude.spec.ts similarity index 99% rename from solgen/test/hardhat/sequencerInbox.spec.ts rename to solgen/test/contract/sequencerInboxForceInclude.spec.ts index 253bfb2ca0..6fb35529a2 100644 --- a/solgen/test/hardhat/sequencerInbox.spec.ts +++ b/solgen/test/contract/sequencerInboxForceInclude.spec.ts @@ -51,7 +51,7 @@ const mineBlocks = async (count: number, timeDiffPerBlock = 14) => { } } -describe('SequencerInbox', async () => { +describe('SequencerInboxForceInclude', async () => { const findMatchingLogs = ( receipt: TransactionReceipt, iFace: TInterface, @@ -88,11 +88,11 @@ describe('SequencerInbox', async () => { const sendUnsignedTx = await inbox .connect(sender) .sendUnsignedTransaction(l2Gas, l2GasPrice, nonce, destAddr, amount, data) + const sendUnsignedTxReceipt = await sendUnsignedTx.wait() const countAfter = (await bridge.functions.messageCount())[0].toNumber() expect(countAfter, 'Unexpected inbox count').to.eq(countBefore + 1) - const sendUnsignedTxReceipt = await sendUnsignedTx.wait() const senderAddr = await sender.getAddress() const l1GasPrice = sendUnsignedTxReceipt.effectiveGasPrice.toNumber() diff --git a/solgen/test/hardhat/utils.ts b/solgen/test/contract/utils.ts similarity index 100% rename from solgen/test/hardhat/utils.ts rename to solgen/test/contract/utils.ts diff --git a/solgen/test/geth/hash-proofs.ts b/solgen/test/prover/hash-proofs.ts similarity index 100% rename from solgen/test/geth/hash-proofs.ts rename to solgen/test/prover/hash-proofs.ts diff --git a/solgen/test/geth/one-step-proof.ts b/solgen/test/prover/one-step-proof.ts similarity index 98% rename from solgen/test/geth/one-step-proof.ts rename to solgen/test/prover/one-step-proof.ts index cd87dc805a..b647d277d4 100644 --- a/solgen/test/geth/one-step-proof.ts +++ b/solgen/test/prover/one-step-proof.ts @@ -20,7 +20,7 @@ async function sendTestMessages() { } describe("OneStepProof", function () { - const root = "./test/geth/proofs/"; + const root = "./test/prover/proofs/"; const dir = fs.readdirSync(root); before(async function () { diff --git a/solgen/test/geth/proofs/.gitkeep b/solgen/test/prover/proofs/.gitkeep similarity index 100% rename from solgen/test/geth/proofs/.gitkeep rename to solgen/test/prover/proofs/.gitkeep diff --git a/solgen/test/geth/value-arrays.ts b/solgen/test/prover/value-arrays.ts similarity index 100% rename from solgen/test/geth/value-arrays.ts rename to solgen/test/prover/value-arrays.ts