Skip to content

Commit

Permalink
Move payload parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mqxf committed Sep 14, 2023
1 parent 1ca2d21 commit ca0b2de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gtest/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>,
program_id: &ProgramId,
) -> Result<Vec<u8>> {
let (actor, _balance) = self
.actors
Expand Down Expand Up @@ -474,11 +474,11 @@ impl ExtManager {

pub(crate) fn read_state_bytes_using_wasm(
&mut self,
payload: Vec<u8>,
program_id: &ProgramId,
fn_name: &str,
wasm: Vec<u8>,
args: Option<Vec<u8>>,
payload: Vec<u8>,
) -> Result<Vec<u8>> {
let mapping_code = Code::try_new_mock_const_or_no_rules(
wasm,
Expand All @@ -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::<SandboxEnvironment<Ext, _>, _>(
String::from(fn_name),
Expand Down
4 changes: 2 additions & 2 deletions gtest/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl<'a> Program<'a> {
pub fn read_state_bytes(&self, payload: Vec<u8>) -> Result<Vec<u8>> {
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
Expand Down Expand Up @@ -507,7 +507,7 @@ impl<'a> Program<'a> {
) -> Result<Vec<u8>> {
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 .
Expand Down

0 comments on commit ca0b2de

Please sign in to comment.