Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
952d072
Merge branch 'staging' into bch/bitcoin.com
sneurlax Jan 31, 2023
eeb2031
add new derive path for bch
sneurlax Jan 31, 2023
3379dd7
add default cases to DerivePathType switches now failing
sneurlax Jan 31, 2023
a68837e
normalize DerivePathType errors
sneurlax Jan 31, 2023
04b4d23
add default derive path case to paynym interface
sneurlax Jan 31, 2023
8d6ef8b
use slip44 in bch wallet
sneurlax Jan 31, 2023
5be3202
linting
sneurlax Jan 31, 2023
9348a22
WIP look up both bip44 and slip44 addresses
sneurlax Jan 31, 2023
71ab8ae
typo fix
sneurlax Jan 31, 2023
6ac8e99
typo fix
sneurlax Jan 31, 2023
c15baa9
remove print
sneurlax Jan 31, 2023
4e606f3
use slip44 addresses by default
sneurlax Jan 31, 2023
fdb0cd7
use AddressType unknown for bip44 derive path type
sneurlax Jan 31, 2023
40ea3da
use address type unknown in _getCurrentAddressForChain, too
sneurlax Jan 31, 2023
a054295
generate different keys for SLIP44 and BIP44 paths
sneurlax Jan 31, 2023
ec59c3a
couple more slips
julian-CStack Jan 31, 2023
d6ba2ab
return slip44 from addressType
sneurlax Jan 31, 2023
962e2b8
slip before bip
sneurlax Jan 31, 2023
7d515d8
Merge remote-tracking branch 'cypherstack/staging' into bch/bitcoin.com
sneurlax Jan 31, 2023
cb13418
revert slip44-bip44, bch's bip44->bch44
sneurlax Jan 31, 2023
98ffd2e
set bch44 derive path to type unknown
sneurlax Feb 1, 2023
9afbb51
handle bip44 and bch44 path addresses when handling outputs
sneurlax Feb 1, 2023
5ae69d4
use bip44 by default
sneurlax Feb 1, 2023
1fbdc22
typofix
sneurlax Feb 1, 2023
3a50198
typo fix in the typo fix
sneurlax Feb 1, 2023
49f2206
separate new derivation path functions into their own non-testnet block
sneurlax Feb 1, 2023
e3aaa8e
cleanup
sneurlax Feb 2, 2023
f39e024
Merge remote-tracking branch 'cypherstack/staging' into bch/bitcoin.com
sneurlax Feb 2, 2023
7ceac0e
disable test
sneurlax Feb 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/services/coins/bitcoin/bitcoin_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ bip32.BIP32 getBip32NodeFromRoot(
case DerivePathType.bip84:
return root.derivePath("m/84'/$coinType'/0'/$chain/$index");
default:
throw Exception("DerivePathType must not be null.");
throw Exception("DerivePathType $derivePathType not supported");
}
}

Expand Down Expand Up @@ -436,7 +436,7 @@ class BitcoinWallet extends CoinServiceAPI
addrType = isar_models.AddressType.p2wpkh;
break;
default:
throw Exception("No Path type $type exists");
throw Exception("DerivePathType $type not supported");
}

final address = isar_models.Address(
Expand Down Expand Up @@ -1560,6 +1560,8 @@ class BitcoinWallet extends CoinServiceAPI
address = P2WPKH(network: _network, data: data).data.address!;
addrType = isar_models.AddressType.p2wpkh;
break;
default:
throw Exception("DerivePathType $derivePathType not supported");
}

// add generated address & info to derivations
Expand Down Expand Up @@ -1606,6 +1608,8 @@ class BitcoinWallet extends CoinServiceAPI
case DerivePathType.bip84:
type = isar_models.AddressType.p2wpkh;
break;
default:
throw Exception("DerivePathType unsupported");
}
address = await db
.getAddresses(walletId)
Expand Down Expand Up @@ -1633,6 +1637,8 @@ class BitcoinWallet extends CoinServiceAPI
case DerivePathType.bip84:
key = "${walletId}_${chainId}DerivationsP2WPKH";
break;
default:
throw Exception("DerivePathType unsupported");
}
return key;
}
Expand Down Expand Up @@ -2645,6 +2651,8 @@ class BitcoinWallet extends CoinServiceAPI
case DerivePathType.bip84:
addressesP2WPKH.add(address);
break;
default:
throw Exception("DerivePathType unsupported");
}
}
}
Expand Down
Loading