Skip to content

Commit

Permalink
fix(addresses): Remove bad todo in bech32 logic (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Nov 24, 2022
1 parent 59ccdcd commit f5c096a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pallas-addresses/src/lib.rs
Expand Up @@ -38,6 +38,9 @@ pub enum Error {
#[error("invalid operation for Byron address")]
InvalidForByron,

#[error("invalid operation for address content")]
InvalidForContent,

#[error("invalid CBOR for Byron address")]
InvalidByronCbor,

Expand Down Expand Up @@ -192,8 +195,8 @@ impl ShelleyDelegationPart {
match self {
Self::Key(x) => Some(x),
Self::Script(x) => Some(x),
Self::Pointer(_) => todo!(),
Self::Null => todo!(),
Self::Pointer(_) => None,
Self::Null => None,
}
}

Expand All @@ -215,8 +218,9 @@ impl ShelleyDelegationPart {
let hrp = match self {
Self::Key(_) => "stake_vkh",
Self::Script(_) => "stake_shared_vkh",
_ => todo!(),
_ => return Err(Error::InvalidForContent),
};

let bytes = self.to_vec();
encode_bech32(&bytes, hrp)
}
Expand Down

0 comments on commit f5c096a

Please sign in to comment.