Skip to content

Commit

Permalink
EVM-IT: Fix deserialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Jan 19, 2023
1 parent db71ced commit a2861e8
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions testing/integration/tests/fevm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use fvm_integration_tests::dummy::DummyExterns;
use fvm_integration_tests::fevm::{Account, BasicTester, CreateReturn};
use fvm_integration_tests::tester::Account as TestAccount;
use fvm_ipld_blockstore::MemoryBlockstore;
use fvm_ipld_encoding::BytesDe;
use fvm_shared::address::Address;
use fvm_shared::state::StateTreeVersion;
use fvm_shared::version::NetworkVersion;
Expand Down Expand Up @@ -232,10 +233,21 @@ impl ContractTester {
gas_limit,
);
*self.account_mut(&acct) = account;
let result = invoke_res.msg_receipt.return_data;

decode_function_data(&call.function, result.bytes(), false)
.expect("error deserializing return data")
if !invoke_res.msg_receipt.exit_code.is_success() {
panic!(
"contract invocation failed: {} -- {:?}",
invoke_res.msg_receipt.exit_code, invoke_res.failure_info,
);
}

let BytesDe(bytes) = invoke_res
.msg_receipt
.return_data
.deserialize()
.expect("error deserializing return data");

decode_function_data(&call.function, bytes, false).expect("error deserializing return data")
}
}

Expand Down

0 comments on commit a2861e8

Please sign in to comment.