Skip to content

Commit 13b10db

Browse files
committed
Use DestinationTag instead of &Destination
1 parent 8d8926a commit 13b10db

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/coin_type.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
use crate::Destination;
16+
use crate::DestinationTag;
1717

1818
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
1919
pub enum CoinType {
@@ -45,35 +45,35 @@ impl CoinType {
4545
11
4646
}
4747

48-
pub const fn address_prefix(&self, destination: &Destination) -> &'static str {
48+
pub const fn address_prefix(&self, destination: DestinationTag) -> &'static str {
4949
match self {
5050
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",
5656
},
5757
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",
6363
},
6464
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",
7070
},
7171
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",
7777
},
7878
}
7979
}

0 commit comments

Comments
 (0)