fix(utxorpc): map missing struct values (#387)

Tx hash and block height are now correctly mapped into the corresponding utxorpc structures.
This commit is contained in:
Clark Alesna 2024-02-12 00:19:13 +08:00 committed by GitHub
parent 4088c2dfcb
commit 6fc4074c02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -408,6 +408,7 @@ fn collect_all_aux_scripts(tx: &trv::MultiEraTx) -> Vec<u5c::Script> {
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 {