Skip to content

Commit

Permalink
fix: remove txn index from validate
Browse files Browse the repository at this point in the history
Signed-off-by: bkioshn <[email protected]>
  • Loading branch information
bkioshn committed Dec 2, 2024
1 parent d0bf563 commit 18ea3aa
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions rust/rbac-registration/src/registration/cardano/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl RegistrationChainInner {

let mut validation_report = Vec::new();
// Do the CIP509 validation, ensuring the basic validation pass.
if !cip509.validate(txn, tx_idx, &mut validation_report) {
if !cip509.validate(txn, &mut validation_report) {
// Log out the error if any
error!("CIP509 validation failed: {:?}", validation_report);
bail!("CIP509 validation failed, {:?}", validation_report);
Expand Down Expand Up @@ -245,7 +245,7 @@ impl RegistrationChainInner {

let mut validation_report = Vec::new();
// Do the CIP509 validation, ensuring the basic validation pass.
if !cip509.validate(txn, tx_idx, &mut validation_report) {
if !cip509.validate(txn, &mut validation_report) {
error!("CIP509 validation failed: {:?}", validation_report);
bail!("CIP509 validation failed, {:?}", validation_report);
}
Expand Down Expand Up @@ -478,22 +478,18 @@ fn update_role_data(
// If there is new role singing key, use it, else use the old one
let signing_key = match role_data.role_signing_key {
Some(key) => Some(key),
None => {
match inner.role_data.get(&role_data.role_number) {
Some((_, role_data)) => role_data.signing_key_ref().clone(),
None => None,
}
None => match inner.role_data.get(&role_data.role_number) {
Some((_, role_data)) => role_data.signing_key_ref().clone(),
None => None,
},
};

// If there is new role encryption key, use it, else use the old one
let encryption_key = match role_data.role_encryption_key {
Some(key) => Some(key),
None => {
match inner.role_data.get(&role_data.role_number) {
Some((_, role_data)) => role_data.encryption_ref().clone(),
None => None,
}
None => match inner.role_data.get(&role_data.role_number) {
Some((_, role_data)) => role_data.encryption_ref().clone(),
None => None,
},
};
let payment_key = get_payment_key_from_tx(txn, role_data.payment_key)?;
Expand Down

0 comments on commit 18ea3aa

Please sign in to comment.