mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
fixes
This commit is contained in:
parent
68e20b25c3
commit
999058cae4
4 changed files with 18 additions and 9 deletions
|
@ -151,10 +151,6 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
|
|||
}
|
||||
}
|
||||
|
||||
print(walletInfo.derivationInfo!.derivationType);
|
||||
print(walletInfo.derivationInfo!.derivationPath);
|
||||
print("@@@@@@@@@@@@@@@");
|
||||
|
||||
return BitcoinWallet(
|
||||
mnemonic: snp.mnemonic,
|
||||
xpub: snp.xpub,
|
||||
|
|
|
@ -4,7 +4,7 @@ Map<DerivationType, List<DerivationInfo>> electrum_derivations = {
|
|||
DerivationType.electrum: [
|
||||
DerivationInfo(
|
||||
derivationType: DerivationType.electrum,
|
||||
derivationPath: "m/0'",
|
||||
derivationPath: "m/0'/0",
|
||||
description: "Electrum",
|
||||
scriptType: "p2wpkh",
|
||||
),
|
||||
|
@ -30,19 +30,19 @@ Map<DerivationType, List<DerivationInfo>> electrum_derivations = {
|
|||
),
|
||||
DerivationInfo(
|
||||
derivationType: DerivationType.bip39,
|
||||
derivationPath: "m/0'",
|
||||
derivationPath: "m/0'/0",
|
||||
description: "Non-standard legacy",
|
||||
scriptType: "p2pkh",
|
||||
),
|
||||
DerivationInfo(
|
||||
derivationType: DerivationType.bip39,
|
||||
derivationPath: "m/0'",
|
||||
derivationPath: "m/0'/0",
|
||||
description: "Non-standard compatibility segwit",
|
||||
scriptType: "p2wpkh-p2sh",
|
||||
),
|
||||
DerivationInfo(
|
||||
derivationType: DerivationType.bip39,
|
||||
derivationPath: "m/0'",
|
||||
derivationPath: "m/0'/0",
|
||||
description: "Non-standard native segwit",
|
||||
scriptType: "p2wpkh",
|
||||
),
|
||||
|
|
|
@ -1371,7 +1371,9 @@ abstract class ElectrumWalletBase
|
|||
final HD = index == null ? hd : hd.derive(index);
|
||||
final priv = ECPrivate.fromHex(HD.privKey!);
|
||||
String messagePrefix = '\x18Bitcoin Signed Message:\n';
|
||||
return priv.signMessage(utf8.encode(message), messagePrefix: messagePrefix);
|
||||
final hexEncoded = priv.signMessage(utf8.encode(message), messagePrefix: messagePrefix);
|
||||
final decodedSig = hex.decode(hexEncoded);
|
||||
return base64Encode(decodedSig);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -766,6 +766,17 @@ Future<void> changeDefaultMoneroNode(
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> fixBtcDerivationPaths(Box<WalletInfo> walletsInfoSource) async {
|
||||
for (WalletInfo walletInfo in walletsInfoSource.values) {
|
||||
if (walletInfo.type == WalletType.bitcoin) {
|
||||
if (walletInfo.derivationInfo?.derivationPath == "m/0'") {
|
||||
walletInfo.derivationInfo!.derivationPath = "m/0'/0";
|
||||
}
|
||||
}
|
||||
await walletInfo.save();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateBtcNanoWalletInfos(Box<WalletInfo> walletsInfoSource) async {
|
||||
for (WalletInfo walletInfo in walletsInfoSource.values) {
|
||||
if (walletInfo.type == WalletType.nano || walletInfo.type == WalletType.bitcoin) {
|
||||
|
|
Loading…
Reference in a new issue