Skip to content

Commit

Permalink
fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lisicky committed Oct 15, 2024
1 parent 1c7f043 commit f0dfc5f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rust/src/protocol_types/plutus/plutus_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ impl PlutusData {
AddrType::Base(addr) => Ok(addr.payment_cred()),
AddrType::Enterprise(addr) => Ok(addr.payment_cred()),
AddrType::Ptr(addr) => Ok(addr.payment_cred()),
AddrType::Reward(addr) => Err(JsError::from_str(
AddrType::Reward(_) => Err(JsError::from_str(
"Cannot convert Reward address to PlutusData",
)),
AddrType::Byron(_) => Err(JsError::from_str(
Expand Down Expand Up @@ -489,14 +489,14 @@ impl PlutusData {

match index {
0 => {
let key_hash = Ed25519KeyHash::from_bytes(bytes).map_err(|e| {
JsError::from_str(&format!("Invalid KeyHash bytes: {}", e))
let key_hash = Ed25519KeyHash::from_bytes(bytes).map_err(|_| {
JsError::from_str("Invalid KeyHash bytes")
})?;
Ok(Credential(CredType::Key(key_hash)))
}
1 => {
let script_hash = ScriptHash::from_bytes(bytes).map_err(|e| {
JsError::from_str(&format!("Invalid ScriptHash bytes: {}", e))
let script_hash = ScriptHash::from_bytes(bytes).map_err(|_| {
JsError::from_str("Invalid ScriptHash bytes")
})?;
Ok(Credential(CredType::Script(script_hash)))
}
Expand Down

0 comments on commit f0dfc5f

Please sign in to comment.