mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-07-30 03:41:28 +00:00
Use the correct coin type
This commit is contained in:
@@ -213,6 +213,15 @@ impl LightClientConfig {
|
||||
}.parse().unwrap()
|
||||
}
|
||||
|
||||
pub fn get_coin_type(&self) -> u32 {
|
||||
match &self.chain_name[..] {
|
||||
"main" => mainnet::COIN_TYPE,
|
||||
"test" => testnet::COIN_TYPE,
|
||||
"regtest" => regtest::COIN_TYPE,
|
||||
c => panic!("Unknown chain {}", c)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn hrp_sapling_address(&self) -> &str {
|
||||
match &self.chain_name[..] {
|
||||
"main" => mainnet::HRP_SAPLING_PAYMENT_ADDRESS,
|
||||
|
@@ -133,13 +133,13 @@ impl LightWallet {
|
||||
return 2;
|
||||
}
|
||||
|
||||
fn get_pk_from_bip39seed(bip39seed: &[u8]) ->
|
||||
fn get_pk_from_bip39seed(config: LightClientConfig, bip39seed: &[u8]) ->
|
||||
(ExtendedSpendingKey, ExtendedFullViewingKey, PaymentAddress<Bls12>) {
|
||||
let extsk: ExtendedSpendingKey = ExtendedSpendingKey::from_path(
|
||||
&ExtendedSpendingKey::master(bip39seed),
|
||||
&[
|
||||
ChildIndex::Hardened(32),
|
||||
ChildIndex::Hardened(1), // TODO: Cointype should be 133 for mainnet
|
||||
ChildIndex::Hardened(config.get_coin_type()),
|
||||
ChildIndex::Hardened(0)
|
||||
],
|
||||
);
|
||||
|
Reference in New Issue
Block a user