From 8f9535cf35b0f2b183ac4013a7ed11b246486964 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:57:42 +1000 Subject: [PATCH] Update integration tests to include --payout-address --- tests/integration/multinodes.nim | 1 + tests/integration/testcli.nim | 13 +++++++++++-- tests/integration/twonodes.nim | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/integration/multinodes.nim b/tests/integration/multinodes.nim index 1ad16a38..fa13b582 100644 --- a/tests/integration/multinodes.nim +++ b/tests/integration/multinodes.nim @@ -204,6 +204,7 @@ template multinodesuite*(name: string, body: untyped) = var config = conf config.addCliOption("--bootstrap-node", bootstrap) config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len]) + config.addCliOption(StartUpCmd.persistence, "--payout-address", $accounts[running.len]) config.addCliOption(PersistenceCmd.prover, "--circom-r1cs", "vendor/codex-contracts-eth/verifier/networks/hardhat/proof_main.r1cs") config.addCliOption(PersistenceCmd.prover, "--circom-wasm", diff --git a/tests/integration/testcli.nim b/tests/integration/testcli.nim index ee0aabe0..b842d822 100644 --- a/tests/integration/testcli.nim +++ b/tests/integration/testcli.nim @@ -3,14 +3,17 @@ import std/tempfiles import codex/conf import codex/utils/fileutils import ./nodes +import ../contracts/examples suite "Command line interface": let key = "4242424242424242424242424242424242424242424242424242424242424242" + let address = Address.example test "complains when persistence is enabled without ethereum account": let node = startNode(@[ - "persistence" + "persistence", + "--payout-address=" & $address ]) node.waitUntilOutput("Persistence enabled, but no Ethereum account was set") node.stop() @@ -20,19 +23,24 @@ suite "Command line interface": discard unsafeKeyFile.writeFile(key, 0o666) let node = startNode(@[ "persistence", + "--payout-address=" & $address, "--eth-private-key=" & unsafeKeyFile]) node.waitUntilOutput("Ethereum private key file does not have safe file permissions") node.stop() discard removeFile(unsafeKeyFile) test "complains when persistence is enabled without accessible r1cs file": - let node = startNode(@["persistence", "prover"]) + let node = startNode(@[ + "persistence", + "--payout-address=" & $address, + "prover"]) node.waitUntilOutput("r1cs file not readable, doesn't exist or wrong extension (.r1cs)") node.stop() test "complains when persistence is enabled without accessible wasm file": let node = startNode(@[ "persistence", + "--payout-address=" & $address, "prover", "--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs" ]) @@ -42,6 +50,7 @@ suite "Command line interface": test "complains when persistence is enabled without accessible zkey file": let node = startNode(@[ "persistence", + "--payout-address=" & $address, "prover", "--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs", "--circom-wasm=tests/circuits/fixtures/proof_main.wasm" diff --git a/tests/integration/twonodes.nim b/tests/integration/twonodes.nim index abf20c57..1b4f6fb8 100644 --- a/tests/integration/twonodes.nim +++ b/tests/integration/twonodes.nim @@ -39,6 +39,7 @@ template twonodessuite*(name: string, debug1, debug2: string, body) = "--disc-port=8090", "--listen-addrs=/ip4/127.0.0.1/tcp/0", "persistence", + "--payout-address=" & $account1, "prover", "--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs", "--circom-wasm=tests/circuits/fixtures/proof_main.wasm", @@ -63,6 +64,7 @@ template twonodessuite*(name: string, debug1, debug2: string, body) = "--listen-addrs=/ip4/127.0.0.1/tcp/0", "--bootstrap-node=" & bootstrap, "persistence", + "--payout-address=" & $account2, "prover", "--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs", "--circom-wasm=tests/circuits/fixtures/proof_main.wasm",