MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / parse_exec_tx_result

Function parse_exec_tx_result

fendermint/rpc/src/query.rs:176–190  ·  view source on GitHub ↗
(res: AbciQuery)

Source from the content-addressed store, hash-verified

174}
175
176fn 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)]
193mod tests {

Callers 1

Calls 3

encode_dataFunction · 0.85
contextMethod · 0.80
as_refMethod · 0.45

Tested by 1