From 0d99fec19b20de6b3450e8bd213f5d0620706329 Mon Sep 17 00:00:00 2001 From: Clark Alesna Date: Sun, 28 Jan 2024 19:26:41 +0800 Subject: [PATCH] Expose Tx->Hash & Block->Height --- 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 0ca503f0..8ca9780b 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 {