diff --git a/rusk/tests/config/multi_transfer_deploy.toml b/rusk/tests/config/multi_transfer_deploy.toml new file mode 100644 index 0000000000..f17449f61a --- /dev/null +++ b/rusk/tests/config/multi_transfer_deploy.toml @@ -0,0 +1,14 @@ +[[phoenix_balance]] +address = "ivmscertKgRyX8wNMJJsQcSVEyPsfSMUQXSAgeAPQXsndqFq9Pmknzhm61QvcEEdxPaGgxDS4RHpb6KKccrnSKN" +seed = 57005 +notes = [10_000_000_000] + +[[phoenix_balance]] +address = "3MoVQ6VfGNu8fJ5GeHPRDVUfxcsDEmGXpWhvKhXY7F2dKCp7QWRw8RqPcbuJGdRqeTtxpuiwETnGAJLnhT4Kq4e8" +seed = 57005 +notes = [10_000_000_000] + +[[phoenix_balance]] +address = "4RyaodGmN8MyUDmpRrtRxJJhrVW2HsY2ycRUnRUXR97JCN1GHraQT9Ygb8yYo7oKzyZg2EXXCGkHBwoeNb96BKtQ" +seed = 57005 +notes = [1_000_000_000_000] diff --git a/rusk/tests/services/multi_transfer.rs b/rusk/tests/services/multi_transfer.rs index 803ce108a7..4761f2b70c 100644 --- a/rusk/tests/services/multi_transfer.rs +++ b/rusk/tests/services/multi_transfer.rs @@ -25,6 +25,7 @@ const BLOCK_HEIGHT: u64 = 1; const BLOCK_GAS_LIMIT: u64 = 24_000_000; const GAS_LIMIT: u64 = 12_000_000; // Lowest value for a transfer const INITIAL_BALANCE: u64 = 10_000_000_000; +const INITIAL_BALANCE_DEPLOY: u64 = 1_000_000_000_000; const BOB_BYTECODE: &[u8] = include_bytes!( "../../../target/dusk/wasm32-unknown-unknown/release/bob.wasm" @@ -39,6 +40,15 @@ fn initial_state>(dir: P) -> Result { new_state(dir, &snapshot, BLOCK_GAS_LIMIT) } +// Creates the Rusk initial state for the tests below +fn initial_state_deploy>(dir: P) -> Result { + let snapshot = + toml::from_str(include_str!("../config/multi_transfer_deploy.toml")) + .expect("Cannot deserialize config"); + + new_state(dir, &snapshot, BLOCK_GAS_LIMIT) +} + /// Executes three different transactions in the same block, expecting only two /// to be included due to exceeding the block gas limit fn wallet_transfer( @@ -218,7 +228,7 @@ fn wallet_transfer_deploy( "Wrong initial balance for the sender" ); assert_eq!( - initial_balance_2, INITIAL_BALANCE, + initial_balance_2, INITIAL_BALANCE_DEPLOY, "Wrong initial balance for the sender" ); @@ -255,7 +265,7 @@ fn wallet_transfer_deploy( init_args, 0, GAS_LIMIT, - 1, + 20_000, ) .expect("Failed to deploy"); txs.push(tx); @@ -387,7 +397,7 @@ pub async fn multi_transfer_deploy() -> Result<()> { logger(); let tmp = tempdir().expect("Should be able to create temporary directory"); - let rusk = initial_state(&tmp)?; + let rusk = initial_state_deploy(&tmp)?; let cache = Arc::new(RwLock::new(HashMap::new()));