Skip to content

Commit

Permalink
Merged from port tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yahgwai committed Feb 22, 2022
2 parents 5900ab8 + 24d9e3e commit af93d84
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ jobs:
cd solgen
yarn install
yarn build
yarn hardhat --network localhost test test/geth/*.ts
yarn hardhat --network localhost test test/prover/*.ts
2 changes: 1 addition & 1 deletion .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const mineBlocks = async (count: number, timeDiffPerBlock = 14) => {
}
}

describe('SequencerInbox', async () => {
describe('SequencerInboxForceInclude', async () => {
const findMatchingLogs = <TInterface extends Interface, TEvent extends Event>(
receipt: TransactionReceipt,
iFace: TInterface,
Expand Down Expand Up @@ -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()
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit af93d84

Please sign in to comment.