@@ -103,7 +103,7 @@ impl PlatformAddress {
103103 /// - Testnet/Devnet/Regtest: "tdash"
104104 pub fn hrp_for_network ( network : Network ) -> & ' static str {
105105 match network {
106- Network :: Dash => PLATFORM_HRP_MAINNET ,
106+ Network :: Mainnet => PLATFORM_HRP_MAINNET ,
107107 Network :: Testnet | Network :: Devnet | Network :: Regtest => PLATFORM_HRP_TESTNET ,
108108 // For any other networks, default to testnet HRP
109109 _ => PLATFORM_HRP_TESTNET ,
@@ -123,7 +123,7 @@ impl PlatformAddress {
123123 /// # Example
124124 /// ```ignore
125125 /// let address = PlatformAddress::P2pkh([0xf7, 0xda, ...]);
126- /// let encoded = address.to_bech32m_string(Network::Dash );
126+ /// let encoded = address.to_bech32m_string(Network::Mainnet );
127127 /// // Returns something like "dash1k..."
128128 /// ```
129129 pub fn to_bech32m_string ( & self , network : Network ) -> String {
@@ -164,7 +164,7 @@ impl PlatformAddress {
164164 // Determine network from HRP (case-insensitive per DIP-0018)
165165 let hrp_lower = hrp. as_str ( ) . to_ascii_lowercase ( ) ;
166166 let network = match hrp_lower. as_str ( ) {
167- s if s == PLATFORM_HRP_MAINNET => Network :: Dash ,
167+ s if s == PLATFORM_HRP_MAINNET => Network :: Mainnet ,
168168 s if s == PLATFORM_HRP_TESTNET => Network :: Testnet ,
169169 _ => {
170170 return Err ( ProtocolError :: DecodingError ( format ! (
@@ -1030,7 +1030,7 @@ mod tests {
10301030 let address = PlatformAddress :: P2pkh ( hash) ;
10311031
10321032 // Encode to bech32m
1033- let encoded = address. to_bech32m_string ( Network :: Dash ) ;
1033+ let encoded = address. to_bech32m_string ( Network :: Mainnet ) ;
10341034
10351035 // Verify exact encoding
10361036 assert_eq ! (
@@ -1042,7 +1042,7 @@ mod tests {
10421042 let ( decoded, network) =
10431043 PlatformAddress :: from_bech32m_string ( & encoded) . expect ( "decoding should succeed" ) ;
10441044 assert_eq ! ( decoded, address) ;
1045- assert_eq ! ( network, Network :: Dash ) ;
1045+ assert_eq ! ( network, Network :: Mainnet ) ;
10461046 }
10471047
10481048 #[ test]
@@ -1080,7 +1080,7 @@ mod tests {
10801080 let address = PlatformAddress :: P2sh ( hash) ;
10811081
10821082 // Encode to bech32m
1083- let encoded = address. to_bech32m_string ( Network :: Dash ) ;
1083+ let encoded = address. to_bech32m_string ( Network :: Mainnet ) ;
10841084
10851085 // Verify exact encoding
10861086 assert_eq ! (
@@ -1092,7 +1092,7 @@ mod tests {
10921092 let ( decoded, network) =
10931093 PlatformAddress :: from_bech32m_string ( & encoded) . expect ( "decoding should succeed" ) ;
10941094 assert_eq ! ( decoded, address) ;
1095- assert_eq ! ( network, Network :: Dash ) ;
1095+ assert_eq ! ( network, Network :: Mainnet ) ;
10961096 }
10971097
10981098 #[ test]
@@ -1170,7 +1170,7 @@ mod tests {
11701170 // Create a valid address, then corrupt the checksum
11711171 let hash: [ u8 ; 20 ] = [ 0xAB ; 20 ] ;
11721172 let address = PlatformAddress :: P2pkh ( hash) ;
1173- let mut encoded = address. to_bech32m_string ( Network :: Dash ) ;
1173+ let mut encoded = address. to_bech32m_string ( Network :: Mainnet ) ;
11741174
11751175 // Corrupt the last character (part of checksum)
11761176 let last_char = encoded. pop ( ) . unwrap ( ) ;
@@ -1239,7 +1239,7 @@ mod tests {
12391239 let hash: [ u8 ; 20 ] = [ 0xAB ; 20 ] ;
12401240 let address = PlatformAddress :: P2pkh ( hash) ;
12411241
1242- let lowercase = address. to_bech32m_string ( Network :: Dash ) ;
1242+ let lowercase = address. to_bech32m_string ( Network :: Mainnet ) ;
12431243 let uppercase = lowercase. to_uppercase ( ) ;
12441244
12451245 // Both should decode to the same address
@@ -1254,7 +1254,7 @@ mod tests {
12541254 fn test_bech32m_all_zeros_p2pkh ( ) {
12551255 // Edge case: all-zero hash
12561256 let address = PlatformAddress :: P2pkh ( [ 0u8 ; 20 ] ) ;
1257- let encoded = address. to_bech32m_string ( Network :: Dash ) ;
1257+ let encoded = address. to_bech32m_string ( Network :: Mainnet ) ;
12581258 let ( decoded, _) = PlatformAddress :: from_bech32m_string ( & encoded) . unwrap ( ) ;
12591259 assert_eq ! ( decoded, address) ;
12601260 }
@@ -1263,14 +1263,14 @@ mod tests {
12631263 fn test_bech32m_all_ones_p2sh ( ) {
12641264 // Edge case: all-ones hash
12651265 let address = PlatformAddress :: P2sh ( [ 0xFF ; 20 ] ) ;
1266- let encoded = address. to_bech32m_string ( Network :: Dash ) ;
1266+ let encoded = address. to_bech32m_string ( Network :: Mainnet ) ;
12671267 let ( decoded, _) = PlatformAddress :: from_bech32m_string ( & encoded) . unwrap ( ) ;
12681268 assert_eq ! ( decoded, address) ;
12691269 }
12701270
12711271 #[ test]
12721272 fn test_hrp_for_network ( ) {
1273- assert_eq ! ( PlatformAddress :: hrp_for_network( Network :: Dash ) , "dash" ) ;
1273+ assert_eq ! ( PlatformAddress :: hrp_for_network( Network :: Mainnet ) , "dash" ) ;
12741274 assert_eq ! ( PlatformAddress :: hrp_for_network( Network :: Testnet ) , "tdash" ) ;
12751275 assert_eq ! ( PlatformAddress :: hrp_for_network( Network :: Devnet ) , "tdash" ) ;
12761276 assert_eq ! ( PlatformAddress :: hrp_for_network( Network :: Regtest ) , "tdash" ) ;
@@ -1312,8 +1312,8 @@ mod tests {
13121312 assert_eq ! ( p2sh. to_bytes( ) [ 0 ] , 0x01 ) ;
13131313
13141314 // Bech32m encoding uses 0xb0/0xb8 (verified by successful roundtrip)
1315- let p2pkh_encoded = p2pkh. to_bech32m_string ( Network :: Dash ) ;
1316- let p2sh_encoded = p2sh. to_bech32m_string ( Network :: Dash ) ;
1315+ let p2pkh_encoded = p2pkh. to_bech32m_string ( Network :: Mainnet ) ;
1316+ let p2sh_encoded = p2sh. to_bech32m_string ( Network :: Mainnet ) ;
13171317
13181318 let ( p2pkh_decoded, _) = PlatformAddress :: from_bech32m_string ( & p2pkh_encoded) . unwrap ( ) ;
13191319 let ( p2sh_decoded, _) = PlatformAddress :: from_bech32m_string ( & p2sh_encoded) . unwrap ( ) ;
0 commit comments