From ca0b2de90ba27783a2490909bec85c57770d5906 Mon Sep 17 00:00:00 2001 From: Maxim Savenkov Date: Thu, 14 Sep 2023 14:59:45 +0200 Subject: [PATCH] Move payload parameter --- gtest/src/manager.rs | 6 +++--- gtest/src/program.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gtest/src/manager.rs b/gtest/src/manager.rs index 58d1867955a..21fa1b2f964 100644 --- a/gtest/src/manager.rs +++ b/gtest/src/manager.rs @@ -443,8 +443,8 @@ impl ExtManager { /// Warning! This is a static call that doesn't change actors pages data. pub(crate) fn read_state_bytes( &mut self, - program_id: &ProgramId, payload: Vec, + program_id: &ProgramId, ) -> Result> { let (actor, _balance) = self .actors @@ -474,11 +474,11 @@ impl ExtManager { pub(crate) fn read_state_bytes_using_wasm( &mut self, + payload: Vec, program_id: &ProgramId, fn_name: &str, wasm: Vec, args: Option>, - payload: Vec, ) -> Result> { let mapping_code = Code::try_new_mock_const_or_no_rules( wasm, @@ -492,7 +492,7 @@ impl ExtManager { .0; let mut mapping_code_payload = args.unwrap_or_default(); - mapping_code_payload.append(&mut self.read_state_bytes(program_id, payload)?); + mapping_code_payload.append(&mut self.read_state_bytes(payload, program_id)?); core_processor::informational::execute_for_reply::, _>( String::from(fn_name), diff --git a/gtest/src/program.rs b/gtest/src/program.rs index 90715fbf3c6..2a50fb9339b 100644 --- a/gtest/src/program.rs +++ b/gtest/src/program.rs @@ -449,7 +449,7 @@ impl<'a> Program<'a> { pub fn read_state_bytes(&self, payload: Vec) -> Result> { self.manager .borrow_mut() - .read_state_bytes(&self.id, payload) + .read_state_bytes(payload, &self.id) } /// Reads the program’s transformed state as a byte vector. The transformed @@ -507,7 +507,7 @@ impl<'a> Program<'a> { ) -> Result> { self.manager .borrow_mut() - .read_state_bytes_using_wasm(&self.id, fn_name, wasm, args, payload) + .read_state_bytes_using_wasm(payload, &self.id, fn_name, wasm, args) } /// Reads and decodes the program's state .