Fix str match for key and addr decoding

This commit is contained in:
Deirdre Connolly 2021-03-19 18:44:02 -04:00 committed by Deirdre Connolly
parent ec5d3a647f
commit 34fe78bd0c
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ impl std::str::FromStr for Address {
network: match hrp.as_str() {
human_readable_parts::MAINNET => Network::Mainnet,
human_readable_parts::TESTNET => Network::Testnet,
_ => Err(SerializationError::Parse("unknown network")),
_ => return Err(SerializationError::Parse("unknown network")),
},
diversifier: keys::Diversifier::from(diversifier_bytes),
transmission_key: keys::TransmissionKey::from(transmission_key_bytes),

View File

@ -186,7 +186,7 @@ impl FromStr for SpendingKey {
network: match hrp.as_str() {
sk_hrp::MAINNET => Network::Mainnet,
sk_hrp::TESTNET => Network::Testnet,
_ => Err(SerializationError::Parse("unknown network")),
_ => return Err(SerializationError::Parse("unknown network")),
},
bytes: decoded_bytes,
})