From 1bbe108ae4f864f9d257a09d38e4baf22ea0b2c0 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Thu, 2 May 2024 13:29:40 +0400 Subject: [PATCH] fix(loadtest): Do not initiate transactions with 0 amount (#1847) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Makes sure that any transaction has amount of 1 wei at least. ## Why ❔ - It is no longer possible to withdraw 0 wei, so the test became flaky. - Testing edge cases is not a point for loadtest, we have integration tests for that. ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`. --- core/tests/loadnext/src/command/tx_command.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tests/loadnext/src/command/tx_command.rs b/core/tests/loadnext/src/command/tx_command.rs index 84e07d1f0d28..a2ac37dfc8b8 100644 --- a/core/tests/loadnext/src/command/tx_command.rs +++ b/core/tests/loadnext/src/command/tx_command.rs @@ -189,6 +189,6 @@ impl TxCommand { } fn random_amount(rng: &mut LoadtestRng) -> U256 { - rng.gen_range(0u64..2u64.pow(18)).into() + rng.gen_range(1u64..2u64.pow(18)).into() } }