Skip to content

Commit

Permalink
fix: Compute datum hash for inline values (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Jan 29, 2023
1 parent 220fcc3 commit 91532f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mapper/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ impl EventWriter {
.encode_address(output.address.as_slice())?,
amount: get_tx_output_coin_value(&output.value),
assets: self.collect_asset_records(&output.value).into(),
datum_hash: match output.datum_option {
datum_hash: match &output.datum_option {
Some(DatumOption::Hash(x)) => Some(x.to_string()),
_ => None,
Some(DatumOption::Data(x)) => Some(x.compute_hash().to_hex()),
None => None,
},
})
}
Expand Down

0 comments on commit 91532f5

Please sign in to comment.