Skip to content

Commit

Permalink
fix: Adjust breaking changes from Pallas v0.17 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Jan 26, 2023
1 parent e09c116 commit 1cdf738
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/reducers/address_by_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ pub struct Reducer {
impl Reducer {
fn to_string_output(&self, asset: Asset) -> Option<String> {
match asset.policy_hex() {
Some(policy_id) if policy_id.eq(&self.config.policy_id_hex) => {
if self.convert_to_ascii {
asset.ascii_name()
} else {
asset.name()
}
}
Some(policy_id) if policy_id.eq(&self.config.policy_id_hex) => match asset {
Asset::NativeAsset(_, name, _) => match self.convert_to_ascii {
true => String::from_utf8(name).ok(),
false => Some(hex::encode(name)),
},
_ => None,
},
_ => None,
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/reducers/utxos_by_asset.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::str::FromStr;

use gasket::error::AsWorkError;
use pallas::crypto::hash::Hash;
use pallas::ledger::traverse::Asset;
Expand Down Expand Up @@ -36,7 +38,7 @@ impl Reducer {
output: &mut super::OutputPort,
) -> Result<(), gasket::error::Error> {
if !self.is_policy_id_accepted(&policy) {
return ();
return Ok(());
}
let tx_hash = tx.hash();
let prefix = self.config.key_prefix.as_deref();
Expand Down

0 comments on commit 1cdf738

Please sign in to comment.