Skip to content

Commit

Permalink
feat: Add witnesses scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SmaugPool committed Apr 10, 2022
1 parent 89312bb commit 808ea00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/mapper/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,26 +361,6 @@ impl EventWriter {
};
}

// TODO: add witness set data to transaction
/*
if let Some(witness) = self.transaction_witness_sets.get(idx) {
let plutus_count = match &witness.plutus_script {
Some(scripts) => scripts.len(),
None => 0,
};
let native_count = match &witness.native_script {
Some(scripts) => scripts.len(),
None => 0,
};
let redeemer_count = match &witness.redeemer {
Some(redeemer) => redeemer.len(),
None => 0,
};
}
*/

if self.config.include_transaction_details {
record.metadata = match aux_data {
Some(aux_data) => self.collect_metadata_records(aux_data)?.into(),
Expand Down
13 changes: 13 additions & 0 deletions src/mapper/shelley.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,19 @@ impl EventWriter {
self.append(EventData::BlockEnd(record))?;
}

for witness in block.transaction_witness_sets.iter() {
if let Some(native) = &witness.native_script {
for script in native.iter() {
self.append(self.to_native_script_event(script))?;
}
}
if let Some(plutus) = &witness.plutus_script {
for script in plutus.iter() {
self.append(self.to_plutus_script_event(script))?;
}
}
}

Ok(())
}

Expand Down

0 comments on commit 808ea00

Please sign in to comment.