fix(addresses): Remove bad todo in bech32 logic (#207)

This commit is contained in:
Santiago Carmuega 2022-11-24 16:36:26 +01:00 committed by GitHub
parent 59ccdcda40
commit f5c096a8ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
@ -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,
}
}
@ -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)
}