Skip to content

Commit

Permalink
feat: use inner tx hash instead of commitment hash (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk authored Aug 2, 2024
1 parent 904c1c3 commit c95b45a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shared/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use namada_tx::data::pos::{
Bond, ClaimRewards, CommissionChange, MetaDataChange, Redelegation, Unbond,
Withdraw,
};
use namada_tx::data::TxType;
use namada_tx::data::{compute_inner_tx_hash, TxType};
use namada_tx::either::Either;
use namada_tx::{Section, Tx};
use serde::Serialize;

Expand Down Expand Up @@ -274,7 +275,10 @@ impl Transaction {
for (index, tx_commitment) in
transaction.header().batch.into_iter().enumerate()
{
let inner_tx_id = Id::from(tx_commitment.get_hash());
let inner_tx_id = Id::from(compute_inner_tx_hash(
Some(&transaction.header_hash()),
Either::Right(&tx_commitment),
));

let memo =
transaction.memo(&tx_commitment).map(|memo_bytes| {
Expand Down

0 comments on commit c95b45a

Please sign in to comment.