From 4e4b0ab1f73abb720e618ddbbda35600bf8c5c96 Mon Sep 17 00:00:00 2001 From: canonbrother Date: Mon, 16 Sep 2024 16:06:48 +0800 Subject: [PATCH] Hrp::parse --- bitcoin/src/address/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs index 82d86448..391f9759 100644 --- a/bitcoin/src/address/mod.rs +++ b/bitcoin/src/address/mod.rs @@ -377,10 +377,8 @@ impl Address { Network::Regtest => SCRIPT_ADDRESS_PREFIX_REGTEST, }; let hrp = match self.network() { - Network::Mainnet => hrp::BC, - Network::Testnet | Network::Devnet => hrp::TB, - // Network::Mainnet => hrp::DF, - // Network::Testnet | Network::Devnet => hrp::TF, + Network::Mainnet => Hrp::parse("df").unwrap(), + Network::Testnet | Network::Devnet => Hrp::parse("tf").unwrap(), Network::Regtest => hrp::BCRT, }; let encoding = AddressEncoding { payload: self.payload(), p2pkh_prefix, p2sh_prefix, hrp };