|
13 | 13 | // See the License for the specific language governing permissions and |
14 | 14 | // limitations under the License. |
15 | 15 |
|
16 | | -use crate::Destination; |
| 16 | +use crate::DestinationTag; |
17 | 17 |
|
18 | 18 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
19 | 19 | pub enum CoinType { |
@@ -45,35 +45,35 @@ impl CoinType { |
45 | 45 | 11 |
46 | 46 | } |
47 | 47 |
|
48 | | - pub const fn address_prefix(&self, destination: &Destination) -> &'static str { |
| 48 | + pub const fn address_prefix(&self, destination: DestinationTag) -> &'static str { |
49 | 49 | match self { |
50 | 50 | Self::Mainnet => match destination { |
51 | | - Destination::AnyoneCanSpend => "mxanyonecanspend", |
52 | | - Destination::PublicKeyHash(_) => "mtc", |
53 | | - Destination::PublicKey(_) => "mptc", |
54 | | - Destination::ScriptHash(_) => "mstc", |
55 | | - Destination::ClassicMultisig(_) => "mmtc", |
| 51 | + DestinationTag::AnyoneCanSpend => "mxanyonecanspend", |
| 52 | + DestinationTag::PublicKeyHash => "mtc", |
| 53 | + DestinationTag::PublicKey => "mptc", |
| 54 | + DestinationTag::ScriptHash => "mstc", |
| 55 | + DestinationTag::ClassicMultisig => "mmtc", |
56 | 56 | }, |
57 | 57 | Self::Testnet => match destination { |
58 | | - Destination::AnyoneCanSpend => "txanyonecanspend", |
59 | | - Destination::PublicKeyHash(_) => "tmt", |
60 | | - Destination::PublicKey(_) => "tpmt", |
61 | | - Destination::ScriptHash(_) => "tstc", |
62 | | - Destination::ClassicMultisig(_) => "tmtc", |
| 58 | + DestinationTag::AnyoneCanSpend => "txanyonecanspend", |
| 59 | + DestinationTag::PublicKeyHash => "tmt", |
| 60 | + DestinationTag::PublicKey => "tpmt", |
| 61 | + DestinationTag::ScriptHash => "tstc", |
| 62 | + DestinationTag::ClassicMultisig => "tmtc", |
63 | 63 | }, |
64 | 64 | Self::Regtest => match destination { |
65 | | - Destination::AnyoneCanSpend => "rxanyonecanspend", |
66 | | - Destination::PublicKeyHash(_) => "rmt", |
67 | | - Destination::PublicKey(_) => "rpmt", |
68 | | - Destination::ScriptHash(_) => "rstc", |
69 | | - Destination::ClassicMultisig(_) => "rmtc", |
| 65 | + DestinationTag::AnyoneCanSpend => "rxanyonecanspend", |
| 66 | + DestinationTag::PublicKeyHash => "rmt", |
| 67 | + DestinationTag::PublicKey => "rpmt", |
| 68 | + DestinationTag::ScriptHash => "rstc", |
| 69 | + DestinationTag::ClassicMultisig => "rmtc", |
70 | 70 | }, |
71 | 71 | Self::Signet => match destination { |
72 | | - Destination::AnyoneCanSpend => "sxanyonecanspend", |
73 | | - Destination::PublicKeyHash(_) => "smt", |
74 | | - Destination::PublicKey(_) => "spmt", |
75 | | - Destination::ScriptHash(_) => "sstc", |
76 | | - Destination::ClassicMultisig(_) => "smtc", |
| 72 | + DestinationTag::AnyoneCanSpend => "sxanyonecanspend", |
| 73 | + DestinationTag::PublicKeyHash => "smt", |
| 74 | + DestinationTag::PublicKey => "spmt", |
| 75 | + DestinationTag::ScriptHash => "sstc", |
| 76 | + DestinationTag::ClassicMultisig => "smtc", |
77 | 77 | }, |
78 | 78 | } |
79 | 79 | } |
|
0 commit comments