Skip to content
Merged
2 changes: 1 addition & 1 deletion rust/rbac-registration/src/cardano/cip509/cip509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ fn payment_history(
report: &ProblemReport,
) -> HashMap<ShelleyAddress, Vec<Payment>> {
let hash = MultiEraTx::Conway(Box::new(Cow::Borrowed(txn))).hash();
let context = format!("Populating payment history for Cip509, transaction hash = {hash:?}");
let context = format!("Populating payment history for Cip509, transaction hash = {hash}");

let mut result: HashMap<_, _> = track_payment_addresses
.iter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn validate_payment_output(
if let Err(e) = compare_key_hash(&[key], witness, 0.into()) {
report.other(
&format!(
"Unable to find payment output key ({key:?}) in the transaction witness set: {e:?}"
"Unable to find payment output key ({key}) in the transaction witness set: {e:?}"
),
context,
);
Expand Down
5 changes: 1 addition & 4 deletions rust/rbac-registration/src/cardano/cip509/utils/cip19.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ pub(crate) fn compare_key_hash(
pk_addrs.iter().try_for_each(|pk_addr| {
// Key hash not found in the transaction witness set
if !witness.check_witness_in_tx(pk_addr, txn_idx) {
bail!(
"Public key hash not found in transaction witness set given {:?}",
pk_addr
);
bail!("Public key hash not found in transaction witness set given {pk_addr}",);
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion rust/rbac-registration/src/cardano/cip509/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn validate_aux(
let hash = Blake2b256Hash::new(raw_aux_data);
if hash != auxiliary_data_hash {
report.other(
&format!("Incorrect transaction auxiliary data hash = '{hash:?}', expected = '{auxiliary_data_hash:?}'"),
&format!("Incorrect transaction auxiliary data hash = '{hash}', expected = '{auxiliary_data_hash}'"),
context,
);
}
Expand Down
19 changes: 4 additions & 15 deletions rust/rbac-registration/src/registration/cardano/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use catalyst_types::{
uuid::UuidV4,
};
use ed25519_dalek::{Signature, VerifyingKey};
use tracing::error;
use update_rbac::{
revocations_list, update_c509_certs, update_public_keys, update_role_data, update_x509_certs,
};
Expand Down Expand Up @@ -345,13 +344,8 @@ impl RegistrationChainInner {
context,
)?;

let (purpose, registration, payment_history) = match cip509.consume() {
Ok(v) => v,
Err(e) => {
let error = format!("Invalid Cip509: {e:?}");
error!(error);
bail!(error);
},
let Ok((purpose, registration, payment_history)) = cip509.consume() else {
bail!("Unable to start a chain: invalid Cip509");
};

let purpose = vec![purpose];
Expand Down Expand Up @@ -436,13 +430,8 @@ impl RegistrationChainInner {
}

let point_tx_idx = cip509.origin().clone();
let (purpose, registration, payment_history) = match cip509.consume() {
Ok(v) => v,
Err(e) => {
let error = format!("Invalid Cip509: {e:?}");
error!(error);
bail!(error);
},
let Ok((purpose, registration, payment_history)) = cip509.consume() else {
bail!("Unable to update a chain: invalid Cip509");
};

// Add purpose to the chain, if not already exist
Expand Down
Loading