diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index 69fa1e40ed..9ee234048f 100644 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -78,7 +78,7 @@ dependencies = [ [[package]] name = "aleph_client" -version = "2.6.0" +version = "2.7.0" dependencies = [ "anyhow", "async-trait", diff --git a/e2e-tests/README.md b/e2e-tests/README.md index 7aaa662010..113c56ee0f 100644 --- a/e2e-tests/README.md +++ b/e2e-tests/README.md @@ -7,10 +7,29 @@ This crate contains e2e test scenarios for the aleph-node. The most basic way to run (assuming a local node is listening on 9944) is: ```bash -$ NODE=ws://127.0.0.1:9944 cargo test name_of_one_test +$ NODE_URL=ws://127.0.0.1:9944 cargo test name_of_one_test ``` Note that the particular test cases might require different numbers of launched nodes, validators, or a particular configuration of the launched nodes, see the documentation for a particular test case for details. Additional options are passed to the tests via env variables. See `src/config.rs` for docs on available options. + +## Running on devnet (or other-net) + +You can also run the tests on some other network. For example, to run the contract test for the `adder` contract on +devnet: + +1. Prepare an account with some money, note the seed of the account. +2. Deploy the contract to devnet: + +```bash +contracts/adder$ NODE_URL=wss://ws.dev.azero.dev AUTHORITY="$THE_SEED" ./deploy.sh +``` + +3. Run the tests: + +```bash +e2e-tests$ RUST_BACKTRACE=1 SUDO_SEED="$THE_SEED" NODE_URL=wss://ws.dev.azero.dev:443 \ + ADDER=$DEPLOY_ADDRESS ADDER_METADATA=../contracts/adder/target/ink/metadata.json cargo test adder -- --nocapture +``` diff --git a/e2e-tests/src/test/helpers.rs b/e2e-tests/src/test/helpers.rs index b8b30a35b8..343e0d6b89 100644 --- a/e2e-tests/src/test/helpers.rs +++ b/e2e-tests/src/test/helpers.rs @@ -60,7 +60,7 @@ pub async fn transfer( to: &KeyPair, amount: Balance, ) -> Result<()> { - conn.transfer(to.signer().public().into(), amount, TxStatus::InBlock) + conn.transfer(to.signer().public().into(), amount, TxStatus::Finalized) .await .map(|_| ()) } @@ -78,7 +78,7 @@ pub async fn basic_test_context( let authority = KeyPairWrapper(aleph_client::keypair_from_string(&config.sudo_seed)); let account = random_account(); - transfer(&authority.sign(&conn), &account, alephs(100)).await?; + transfer(&authority.sign(&conn), &account, alephs(1)).await?; Ok((conn, authority, account)) }