From 6fc4074c0262f2b717e85732ffc751affc7313b7 Mon Sep 17 00:00:00 2001 From: Clark Alesna Date: Mon, 12 Feb 2024 00:19:13 +0800 Subject: [PATCH] fix(utxorpc): map missing struct values (#387) Tx hash and block height are now correctly mapped into the corresponding utxorpc structures. --- pallas-utxorpc/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pallas-utxorpc/src/lib.rs b/pallas-utxorpc/src/lib.rs index 0ca503f..8ca9780 100644 --- a/pallas-utxorpc/src/lib.rs +++ b/pallas-utxorpc/src/lib.rs @@ -408,6 +408,7 @@ fn collect_all_aux_scripts(tx: &trv::MultiEraTx) -> Vec { pub fn map_tx(tx: &trv::MultiEraTx) -> u5c::Tx { u5c::Tx { + hash: tx.hash().to_vec().into(), inputs: tx.inputs().iter().map(|i| map_tx_input(i, tx)).collect(), outputs: tx.outputs().iter().map(map_tx_output).collect(), certificates: tx.certs().iter().map(map_cert).collect(), @@ -468,6 +469,7 @@ pub fn map_block(block: &trv::MultiEraBlock) -> u5c::Block { header: u5c::BlockHeader { slot: block.slot(), hash: block.hash().to_vec().into(), + height: block.number() } .into(), body: u5c::BlockBody {