pub fn decode_contract_result(response: &[u8]) -> Result<Vec<u8>, String>Expand description
Decode the SCALE-encoded ContractResult from pallet-revive’s ReviveApi::call.
§Layout (pallet-revive, Asset Hub Paseo, 2025-03)
This is a hand-rolled positional decoder. The field order is:
- gas_consumed: Weight { ref_time: Compact
, proof_size: Compact } - gas_required: Weight { ref_time: Compact
, proof_size: Compact } - storage_deposit: StorageDeposit enum (1 byte tag + u128)
- [pallet-revive extra] Option
(1 tag + 16 if Some) - [pallet-revive extra] Balance (16 bytes u128)
- debug_message: Vec
(Compact len + bytes) - result: ExecReturnValue { flags: u32, data: Vec
} (no Result wrapper)
If pallet-revive changes its ContractResult layout, this decoder must be updated and a new test vector captured.