Skip to content

Commit

Permalink
fix: add plutus v2 witnesses missing in babbage txs (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
joacohoyos authored Sep 1, 2024
1 parent 2fb369d commit e1b9713
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/mapper/babbage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,26 @@ impl EventWriter {
.collect_native_witness_records(&witnesses.native_script)?
.into();

record.plutus_witnesses = self
.collect_plutus_v1_witness_records(&witnesses.plutus_v1_script)?
.into();
let mut all_plutus = vec![];

let plutus_v1: Vec<_> = witnesses
.plutus_v1_script
.iter()
.flatten()
.map(|i| self.to_plutus_v1_witness_record(i))
.collect::<Result<_, _>>()?;

all_plutus.extend(plutus_v1);

let plutus_v2: Vec<_> = witnesses
.plutus_v2_script
.iter()
.flatten()
.map(|i| self.to_plutus_v2_witness_record(i))
.collect::<Result<_, _>>()?;

all_plutus.extend(plutus_v2);
record.plutus_witnesses = Some(all_plutus);
record.plutus_redeemers = self
.collect_plutus_redeemer_records(&witnesses.redeemer)?
.into();
Expand Down

0 comments on commit e1b9713

Please sign in to comment.