| 174 | } |
| 175 | |
| 176 | fn parse_exec_tx_result(res: AbciQuery) -> anyhow::Result<ExecTxResult> { |
| 177 | let bz: Vec<u8> = |
| 178 | fvm_ipld_encoding::from_slice(&res.value).context("failed to decode IPLD as bytes")?; |
| 179 | |
| 180 | let deliver_tx = tendermint_proto::abci::ExecTxResult::decode(bz.as_ref()) |
| 181 | .context("failed to deserialize ResponseDeliverTx from proto bytes")?; |
| 182 | |
| 183 | let mut deliver_tx = tendermint::abci::types::ExecTxResult::try_from(deliver_tx) |
| 184 | .context("failed to create DeliverTx from proto response")?; |
| 185 | |
| 186 | // Mimic the Base64 encoding of the value that Tendermint does. |
| 187 | deliver_tx.data = encode_data(&deliver_tx.data); |
| 188 | |
| 189 | Ok(deliver_tx) |
| 190 | } |
| 191 | |
| 192 | #[cfg(test)] |
| 193 | mod tests { |