Skip to content

Commit

Permalink
fix(voting-tools-rs): code format
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenj committed Sep 13, 2024
1 parent 562b524 commit 29a328b
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/voting-tools-rs/src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl RawRegistration {
&self,
cddl_config: &CddlConfig,
network_id: NetworkId,
slot_no: SlotNo
slot_no: SlotNo,
) -> Result<SignedRegistration, Box<dyn Error>> {
// validate cddl: 61284
validate_reg_cddl(&self.bin_reg, cddl_config)?;
Expand All @@ -246,7 +246,11 @@ impl RawRegistration {
})
}

fn raw_reg_conversion(&self, network_id: NetworkId, slot_no: SlotNo) -> Result<Registration, Box<dyn Error>> {
fn raw_reg_conversion(
&self,
network_id: NetworkId,
slot_no: SlotNo,
) -> Result<Registration, Box<dyn Error>> {
let decoded: ciborium::value::Value =
ciborium::de::from_reader(Cursor::new(&self.bin_reg))?;

Expand Down Expand Up @@ -284,11 +288,14 @@ impl RawRegistration {

// A nonce that identifies that most recent delegation
let nonce = match inspect_nonce(metamap) {
Ok(value) => if value.0 < slot_no.0 { // Don't allow nonce > slot number
value
} else {
Nonce(slot_no.0)
},
Ok(value) => {
if value.0 < slot_no.0 {
// Don't allow nonce > slot number
value
} else {
Nonce(slot_no.0)
}
}
Err(value) => return value,
};

Expand Down

0 comments on commit 29a328b

Please sign in to comment.