chore(wallet): fix lint warnings (#344)
This commit is contained in:
parent
90c66047c5
commit
86663a9b24
1 changed files with 2 additions and 2 deletions
|
|
@ -116,7 +116,7 @@ impl Bip32PrivateKey {
|
||||||
pub fn from_bech32(bech32: String) -> Result<Self, Error> {
|
pub fn from_bech32(bech32: String) -> Result<Self, Error> {
|
||||||
let (hrp, data, _) = bech32::decode(&bech32).map_err(Error::InvalidBech32)?;
|
let (hrp, data, _) = bech32::decode(&bech32).map_err(Error::InvalidBech32)?;
|
||||||
if hrp != Self::BECH32_HRP {
|
if hrp != Self::BECH32_HRP {
|
||||||
return Err(Error::InvalidBech32Hrp);
|
Err(Error::InvalidBech32Hrp)
|
||||||
} else {
|
} else {
|
||||||
let data = Vec::<u8>::from_base32(&data).map_err(Error::InvalidBech32)?;
|
let data = Vec::<u8>::from_base32(&data).map_err(Error::InvalidBech32)?;
|
||||||
Self::from_bytes(data.try_into().map_err(|_| Error::UnexpectedBech32Length)?)
|
Self::from_bytes(data.try_into().map_err(|_| Error::UnexpectedBech32Length)?)
|
||||||
|
|
@ -166,7 +166,7 @@ impl Bip32PublicKey {
|
||||||
pub fn from_bech32(bech32: String) -> Result<Self, Error> {
|
pub fn from_bech32(bech32: String) -> Result<Self, Error> {
|
||||||
let (hrp, data, _) = bech32::decode(&bech32).map_err(Error::InvalidBech32)?;
|
let (hrp, data, _) = bech32::decode(&bech32).map_err(Error::InvalidBech32)?;
|
||||||
if hrp != Self::BECH32_HRP {
|
if hrp != Self::BECH32_HRP {
|
||||||
return Err(Error::InvalidBech32Hrp);
|
Err(Error::InvalidBech32Hrp)
|
||||||
} else {
|
} else {
|
||||||
let data = Vec::<u8>::from_base32(&data).map_err(Error::InvalidBech32)?;
|
let data = Vec::<u8>::from_base32(&data).map_err(Error::InvalidBech32)?;
|
||||||
Ok(Self::from_bytes(
|
Ok(Self::from_bytes(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue