From 29e12507f2c9421e664d35c85b6bb2e096184b4b Mon Sep 17 00:00:00 2001 From: Leo-Besancon Date: Tue, 11 Jun 2024 13:45:11 +0200 Subject: [PATCH] Update scenarios_mandatories.rs --- .../src/tests/scenarios_mandatories.rs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/massa-execution-worker/src/tests/scenarios_mandatories.rs b/massa-execution-worker/src/tests/scenarios_mandatories.rs index 5733b27f79b..b80355791cd 100644 --- a/massa-execution-worker/src/tests/scenarios_mandatories.rs +++ b/massa-execution-worker/src/tests/scenarios_mandatories.rs @@ -606,6 +606,18 @@ fn send_and_receive_async_message() { let saved_bytecode = Arc::new(RwLock::new(None)); let saved_bytecode_edit = saved_bytecode.clone(); let finalized_waitpoint_trigger_handle = finalized_waitpoint.get_trigger_handle(); + + let destination = match *CHAINID { + 77 => Address::from_str("AS12jc7fTsSKwQ9hSk97C3iMNgNT1XrrD6MjSJRJZ4NE53YgQ4kFV").unwrap(), + 77658366 => { + Address::from_str("AS12DSPbsNvvdP1ScCivmKpbQfcJJ3tCQFkNb8ewkRuNjsgoL2AeQ").unwrap() + } + 77658377 => { + Address::from_str("AS127QtY6Hzm6BnJc9wqCBfPNvEH9fKer3LiMNNQmcX3MzLwCL6G6").unwrap() + } + _ => panic!("CHAINID not supported"), + }; + // Expected message from SC: send_message.ts (see massa unit tests src repo) let message = AsyncMessage { emission_slot: Slot { @@ -616,8 +628,7 @@ fn send_and_receive_async_message() { sender: Address::from_str("AU1TyzwHarZMQSVJgxku8co7xjrRLnH74nFbNpoqNd98YhJkWgi").unwrap(), // Note: generated address (from send_message.ts createSC call) // this can changes when modification to the final state are done (see create_new_sc_address function) - destination: Address::from_str("AS127QtY6Hzm6BnJc9wqCBfPNvEH9fKer3LiMNNQmcX3MzLwCL6G6") - .unwrap(), + destination, function: String::from("receive"), // value from SC: send_message.ts max_gas: 3000000, @@ -668,15 +679,7 @@ fn send_and_receive_async_message() { .times(1) .with(predicate::eq(Slot::new(1, 1)), predicate::always()) .returning(move |_, changes| { - match changes - .ledger_changes - .0 - .get( - &Address::from_str("AS127QtY6Hzm6BnJc9wqCBfPNvEH9fKer3LiMNNQmcX3MzLwCL6G6") - .unwrap(), - ) - .unwrap() - { + match changes.ledger_changes.0.get(&destination).unwrap() { // sc has received the coins (0.0000001) SetUpdateOrDelete::Update(change_sc_update) => { assert_eq!(