merge fixes pt.1 [skip ci]

This commit is contained in:
Matthew Fosse 2024-09-20 11:56:04 -07:00
parent fc51847915
commit f2ddbcf740
8 changed files with 16 additions and 29 deletions

View file

@ -170,25 +170,16 @@ abstract class ElectrumWalletBase
Set<String> get addressesSet => walletAddresses.allAddresses.map((addr) => addr.address).toSet();
List<String> get scriptHashes => walletAddresses.addressesByReceiveType
.where((addr) => RegexUtils.addressTypeFromStr(addr.address, network) is! MwebAddress)
.map((addr) => (addr as BitcoinAddressRecord).getScriptHash(network))
.toList();
List<String> get publicScriptHashes => walletAddresses.allAddresses
.where((addr) => !addr.isHidden)
.where((addr) => RegexUtils.addressTypeFromStr(addr.address, network) is! MwebAddress)
.map((addr) => addr.getScriptHash(network))
.toList();
// TODO: remove this
// List<String> get scriptHashes => walletAddresses.addressesByReceiveType
// .where((addr) => addressTypeFromStr(addr.address, network) is! MwebAddress)
// .map((addr) => scriptHash(addr.address, network: network))
// .toList();
// List<String> get publicScriptHashes => walletAddresses.allAddresses
// .where((addr) => !addr.isHidden)
// .where((addr) => addressTypeFromStr(addr.address, network) is! MwebAddress)
// .map((addr) => scriptHash(addr.address, network: network))
// .toList();
String get xpub => accountHD.publicKey.toExtended;
@override
@ -1908,7 +1899,7 @@ abstract class ElectrumWalletBase
Future<ElectrumBalance> fetchBalances() async {
final addresses = walletAddresses.allAddresses
.where((address) => addressTypeFromStr(address.address, network) is! MwebAddress)
.where((address) => RegexUtils.addressTypeFromStr(address.address, network) is! MwebAddress)
.toList();
final balanceFutures = <Future<Map<String, dynamic>>>[];
for (var i = 0; i < addresses.length; i++) {

View file

@ -906,7 +906,8 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
return TxWitnessInput(stack: [key.signInput(digest), key.getPublic().toHex()]);
}).toList())
.toHex();
tx.outputs = resp.outputId;
tx.outputAddresses = resp.outputId;
return tx
..addListener((transaction) async {
final addresses = <String>{};

View file

@ -39,7 +39,7 @@ class PendingBitcoinTransaction with PendingTransaction {
bool isMweb;
String? idOverride;
String? hexOverride;
List<String>? outputs;
List<String>? outputAddresses;
@override
String get id => idOverride ?? _tx.txId();
@ -139,6 +139,6 @@ class PendingBitcoinTransaction with PendingTransaction {
isPending: true,
confirmations: 0,
inputAddresses: _tx.inputs.map((input) => input.txId).toList(),
outputAddresses: outputs,
outputAddresses: outputAddresses,
fee: fee);
}

View file

@ -63,7 +63,7 @@ dependency_overrides:
bitcoin_base:
git:
url: https://github.com/cake-tech/bitcoin_base
ref: cake-update-v7
ref: cake-update-v8
pointycastle: 3.7.4
ffi: 2.1.0

View file

@ -42,7 +42,7 @@ dependency_overrides:
bitcoin_base:
git:
url: https://github.com/cake-tech/bitcoin_base
ref: cake-update-v7
ref: cake-update-v8
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

View file

@ -13,20 +13,20 @@ public static func register(with registrar: FlutterPluginRegistrar) {
private static var port: Int = 0
private static var dataDir: String?
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) async {
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
switch call.method {
case "getPlatformVersion":
result("iOS " + UIDevice.current.systemVersion)
break
case "start":
await stopServer()
stopServer()
let args = call.arguments as? [String: String]
let dataDir = args?["dataDir"]
CwMwebPlugin.dataDir = dataDir
await startServer(result: result)
startServer(result: result)
break
case "stop":
await stopServer()
stopServer()
result(nil)
break
case "address":

View file

@ -614,12 +614,7 @@ class CWBitcoin extends Bitcoin {
bool txIsMweb(TransactionInfo txInfo) {
final tx = txInfo as ElectrumTransactionInfo;
List<String> addresses =
(transaction.inputAddresses ?? []) + (transaction.outputAddresses ?? []);
for (var address in addresses) {
if (address.toLowerCase().contains("mweb")) {
return true;
}
}
// return tx.isMweb;
return false;
}
}

View file

@ -135,7 +135,7 @@ dependency_overrides:
bitcoin_base:
git:
url: https://github.com/cake-tech/bitcoin_base
ref: cake-update-v7
ref: cake-update-v8
ffi: 2.1.0
flutter_icons: