Skip to content

Commit 00fa07d

Browse files
committed
chore: fix format
Signed-off-by: bkioshn <[email protected]>
1 parent 3d4ff45 commit 00fa07d

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

rust/rbac-registration/src/cardano/cip509/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ impl Cip509 {
205205
for role in role_set {
206206
if role.role_number == 0 {
207207
stake_key_validate =
208-
validate_stake_public_key(self, txn, validation_report)
209-
.unwrap_or(false);
208+
validate_stake_public_key(self, txn, validation_report).unwrap_or(false);
210209
payment_key_validate =
211210
validate_payment_key(txn, txn_idx, role, validation_report)
212211
.unwrap_or(false);

rust/rbac-registration/src/cardano/cip509/rbac/pub_key.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ impl Decode<'_, ()> for SimplePublicKeyType {
7777
}
7878
},
7979
minicbor::data::Type::Undefined => Ok(Self::Undefined),
80-
_ => Err(decode::Error::message(
81-
"Invalid datatype for SimplePublicKeyType",
82-
)),
80+
_ => {
81+
Err(decode::Error::message(
82+
"Invalid datatype for SimplePublicKeyType",
83+
))
84+
},
8385
}
8486
}
8587
}

rust/rbac-registration/src/cardano/cip509/validation.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ use super::{
4444

4545
/// Context-specific primitive type with tag number 6 (`raw_tag` 134) for
4646
/// uniform resource identifier (URI) in the subject alternative name extension.
47-
/// Following the ASN.1 <https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/asn1-tags.html>,
47+
/// Following the ASN.1
48+
/// <https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/asn1-tags.html>
4849
/// the tag is derive from
4950
/// | Class (2 bit) | P/C (1 bit) | Tag Number (5 bit) |
5051
/// |`CONTEXT_SPECIFIC` | `PRIMITIVE` `| 6` |
@@ -164,7 +165,6 @@ pub(crate) fn validate_stake_public_key(
164165

165166
// Extract the CIP19 hash and push into
166167
// array
167-
println!("{:?}", &addr);
168168
if let Some(h) =
169169
extract_cip19_hash(&addr, Some("stake"))
170170
{
@@ -267,8 +267,8 @@ pub(crate) fn validate_stake_public_key(
267267

268268
Some(
269269
// Set transaction index to 0 because the list of transaction is manually constructed
270-
// for TxWitness -> &[txn.clone()], so we can assume that the witness contains only the witness
271-
// within this transaction.
270+
// for TxWitness -> &[txn.clone()], so we can assume that the witness contains only
271+
// the witness within this transaction.
272272
compare_key_hash(&pk_addrs, &witnesses, 0)
273273
.map_err(|e| {
274274
validation_report.push(format!(
@@ -278,7 +278,6 @@ pub(crate) fn validate_stake_public_key(
278278
.is_ok(),
279279
)
280280
}
281-
// pk addrs [[224, 117, 190, 16, 236, 92, 87, 92, 175, 251, 104, 176, 140, 49, 71, 6, 102, 212, 254, 26, 238, 160, 124, 22, 214, 71, 57, 3]]
282281

283282
// ------------------------ Validate Aux ------------------------
284283

rust/rbac-registration/src/cardano/transaction/witness.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ mod tests {
117117
.expect("Failed to decode vkey1_hash")
118118
.try_into()
119119
.expect("Invalid length of vkey1_hash");
120-
println!("{tx_witness_conway}");
121120
assert!(tx_witness_conway.get_witness_pk_addr(&vkey1_hash).is_some());
122121
assert!(tx_witness_conway.check_witness_in_tx(&vkey1_hash, 0));
123122
}

rust/rbac-registration/src/utils/decode_helper.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ mod tests {
209209
let mut d = Decoder::new(&buf);
210210
let result = decode_any(&mut d, "test");
211211
// Should print out the error message with the location of the error
212-
println!("{result:?}");
213212
assert!(result.is_err());
214213
}
215214
}

0 commit comments

Comments
 (0)