fix(addresses): Remove bad todo in bech32 logic (#207)
This commit is contained in:
parent
a60525d9ff
commit
7ca2b0e8cb
1 changed files with 7 additions and 3 deletions
|
|
@ -38,6 +38,9 @@ pub enum Error {
|
||||||
#[error("invalid operation for Byron address")]
|
#[error("invalid operation for Byron address")]
|
||||||
InvalidForByron,
|
InvalidForByron,
|
||||||
|
|
||||||
|
#[error("invalid operation for address content")]
|
||||||
|
InvalidForContent,
|
||||||
|
|
||||||
#[error("invalid CBOR for Byron address")]
|
#[error("invalid CBOR for Byron address")]
|
||||||
InvalidByronCbor,
|
InvalidByronCbor,
|
||||||
|
|
||||||
|
|
@ -192,8 +195,8 @@ impl ShelleyDelegationPart {
|
||||||
match self {
|
match self {
|
||||||
Self::Key(x) => Some(x),
|
Self::Key(x) => Some(x),
|
||||||
Self::Script(x) => Some(x),
|
Self::Script(x) => Some(x),
|
||||||
Self::Pointer(_) => todo!(),
|
Self::Pointer(_) => None,
|
||||||
Self::Null => todo!(),
|
Self::Null => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -215,8 +218,9 @@ impl ShelleyDelegationPart {
|
||||||
let hrp = match self {
|
let hrp = match self {
|
||||||
Self::Key(_) => "stake_vkh",
|
Self::Key(_) => "stake_vkh",
|
||||||
Self::Script(_) => "stake_shared_vkh",
|
Self::Script(_) => "stake_shared_vkh",
|
||||||
_ => todo!(),
|
_ => return Err(Error::InvalidForContent),
|
||||||
};
|
};
|
||||||
|
|
||||||
let bytes = self.to_vec();
|
let bytes = self.to_vec();
|
||||||
encode_bech32(&bytes, hrp)
|
encode_bech32(&bytes, hrp)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue