Revert "FIX (#2283)" (#2298)

This reverts commit 7b8ddf9685.
This commit is contained in:
Omar Hatem 2025-05-29 16:54:22 +03:00 committed by GitHub
parent b77c22b0df
commit d332377a2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 402 additions and 667 deletions

View file

@ -213,9 +213,9 @@ class CWBitcoin extends Bitcoin {
return bitcoinWallet.unspentCoins.where((element) {
switch (coinTypeToSpendFrom) {
case UnspentCoinType.mweb:
return element.bitcoinAddressRecord.type == SegwitAddressType.mweb;
return element.bitcoinAddressRecord.type == SegwitAddresType.mweb;
case UnspentCoinType.nonMweb:
return element.bitcoinAddressRecord.type != SegwitAddressType.mweb;
return element.bitcoinAddressRecord.type != SegwitAddresType.mweb;
case UnspentCoinType.any:
return true;
}
@ -296,14 +296,14 @@ class CWBitcoin extends Bitcoin {
case BitcoinReceivePageOption.p2sh:
return P2shAddressType.p2wpkhInP2sh;
case BitcoinReceivePageOption.p2tr:
return SegwitAddressType.p2tr;
return SegwitAddresType.p2tr;
case BitcoinReceivePageOption.p2wsh:
return SegwitAddressType.p2wsh;
return SegwitAddresType.p2wsh;
case BitcoinReceivePageOption.mweb:
return SegwitAddressType.mweb;
return SegwitAddresType.mweb;
case BitcoinReceivePageOption.p2wpkh:
default:
return SegwitAddressType.p2wpkh;
return SegwitAddresType.p2wpkh;
}
}
@ -527,7 +527,7 @@ class CWBitcoin extends Bitcoin {
List<ElectrumSubAddress> getSilentPaymentAddresses(Object wallet) {
final bitcoinWallet = wallet as ElectrumWallet;
return bitcoinWallet.walletAddresses.silentAddresses
.where((addr) => addr.type != SegwitAddressType.p2tr)
.where((addr) => addr.type != SegwitAddresType.p2tr)
.map((addr) => ElectrumSubAddress(
id: addr.index,
name: addr.name,
@ -542,7 +542,7 @@ class CWBitcoin extends Bitcoin {
List<ElectrumSubAddress> getSilentPaymentReceivedAddresses(Object wallet) {
final bitcoinWallet = wallet as ElectrumWallet;
return bitcoinWallet.walletAddresses.silentAddresses
.where((addr) => addr.type == SegwitAddressType.p2tr)
.where((addr) => addr.type == SegwitAddresType.p2tr)
.map((addr) => ElectrumSubAddress(
id: addr.index,
name: addr.name,
@ -712,7 +712,7 @@ class CWBitcoin extends Bitcoin {
try {
final electrumWallet = wallet as ElectrumWallet;
final segwitAddress = electrumWallet.walletAddresses.allAddresses
.firstWhere((element) => !element.isUsed && element.type == SegwitAddressType.p2wpkh);
.firstWhere((element) => !element.isUsed && element.type == SegwitAddresType.p2wpkh);
return segwitAddress.address;
} catch (_) {
return null;