Tidy *serialize for TransparentAddress with match on network
This commit is contained in:
parent
a6d511eb71
commit
760edf9271
|
@ -159,10 +159,9 @@ impl ZcashSerialize for TransparentAddress {
|
||||||
} => {
|
} => {
|
||||||
// Dev network doesn't have a recommendation so we
|
// Dev network doesn't have a recommendation so we
|
||||||
// default to testnet bytes if it's not mainnet.
|
// default to testnet bytes if it's not mainnet.
|
||||||
if *network == Network::Mainnet {
|
match *network {
|
||||||
writer.write_all(&magics::p2sh::MAINNET[..])?
|
Network::Mainnet => writer.write_all(&magics::p2sh::MAINNET[..])?,
|
||||||
} else {
|
_ => writer.write_all(&magics::p2sh::TESTNET[..])?,
|
||||||
writer.write_all(&magics::p2sh::TESTNET[..])?
|
|
||||||
}
|
}
|
||||||
writer.write_all(script_hash)?
|
writer.write_all(script_hash)?
|
||||||
}
|
}
|
||||||
|
@ -172,10 +171,9 @@ impl ZcashSerialize for TransparentAddress {
|
||||||
} => {
|
} => {
|
||||||
// Dev network doesn't have a recommendation so we
|
// Dev network doesn't have a recommendation so we
|
||||||
// default to testnet bytes if it's not mainnet.
|
// default to testnet bytes if it's not mainnet.
|
||||||
if *network == Network::Mainnet {
|
match *network {
|
||||||
writer.write_all(&magics::p2pkh::MAINNET[..])?
|
Network::Mainnet => writer.write_all(&magics::p2pkh::MAINNET[..])?,
|
||||||
} else {
|
_ => writer.write_all(&magics::p2pkh::TESTNET[..])?,
|
||||||
writer.write_all(&magics::p2pkh::TESTNET[..])?
|
|
||||||
}
|
}
|
||||||
writer.write_all(pub_key_hash)?
|
writer.write_all(pub_key_hash)?
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue