Skip to content

Commit

Permalink
fix(interop): check for spend purpose when matching redeemers (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Jul 13, 2024
1 parent 2c9c98a commit 15538cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pallas-utxorpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ use std::{collections::HashMap, ops::Deref};

use pallas_codec::utils::KeyValuePairs;
use pallas_crypto::hash::Hash;
use pallas_primitives::{alonzo, babbage, conway};
use pallas_primitives::{
alonzo, babbage,
conway::{self, RedeemerTag},
};
use pallas_traverse as trv;

use trv::OriginalHash;
Expand Down Expand Up @@ -62,7 +65,9 @@ impl<C: LedgerContext> Mapper<C> {
) -> u5c::TxInput {
let redeemers = tx.redeemers();

let redeemer = redeemers.iter().find(|r| (r.index() as u64) == i.index());
let redeemer = redeemers
.iter()
.find(|r| r.tag() == RedeemerTag::Spend && (r.index() as u64) == i.index());

let as_txref = (*i.hash(), i.index() as u32);

Expand Down

0 comments on commit 15538cd

Please sign in to comment.