diff --git a/lib/models/isar/models/blockchain_data/transaction.dart b/lib/models/isar/models/blockchain_data/transaction.dart index 39d2cc0af..e3e3d0595 100644 --- a/lib/models/isar/models/blockchain_data/transaction.dart +++ b/lib/models/isar/models/blockchain_data/transaction.dart @@ -12,6 +12,7 @@ part 'transaction.g.dart'; @Collection() class Transaction { + Transaction({ required this.walletId, required this.txid, @@ -29,6 +30,7 @@ class Transaction { required this.inputs, required this.outputs, required this.nonce, + required this.numberOfMessages, }); Tuple2 copyWith({ @@ -50,6 +52,7 @@ class Transaction { int? nonce, Id? id, Address? address, + int? numberOfMessages, }) { return Tuple2( Transaction( @@ -68,7 +71,8 @@ class Transaction { otherData: otherData ?? this.otherData, nonce: nonce ?? this.nonce, inputs: inputs ?? this.inputs, - outputs: outputs ?? this.outputs) + outputs: outputs ?? this.outputs, + numberOfMessages: numberOfMessages ?? this.numberOfMessages) ..id = id ?? this.id, address ?? this.address.value, ); @@ -114,6 +118,8 @@ class Transaction { late final List outputs; + late final int? numberOfMessages; + @Backlink(to: "transactions") final address = IsarLink
(); @@ -154,6 +160,7 @@ class Transaction { "address: ${address.value}, " "inputsLength: ${inputs.length}, " "outputsLength: ${outputs.length}, " + "numberOfMessages: $numberOfMessages, " "}"; String toJsonString() { @@ -175,6 +182,7 @@ class Transaction { "address": address.value?.toJsonString(), "inputs": inputs.map((e) => e.toJsonString()).toList(), "outputs": outputs.map((e) => e.toJsonString()).toList(), + "numberOfMessages": numberOfMessages, }; return jsonEncode(result); } @@ -205,6 +213,7 @@ class Transaction { outputs: List.from(json["outputs"] as List) .map((e) => Output.fromJsonString(e)) .toList(), + numberOfMessages: json["numberOfMessages"] as int, ); if (json["address"] == null) { return Tuple2(transaction, null); diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart index 74a5a1652..c11649ddb 100644 --- a/lib/models/isar/models/blockchain_data/transaction.g.dart +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -58,46 +58,51 @@ const TransactionSchema = CollectionSchema( name: r'nonce', type: IsarType.long, ), - r'otherData': PropertySchema( + r'numberOfMessages': PropertySchema( id: 8, + name: r'numberOfMessages', + type: IsarType.long, + ), + r'otherData': PropertySchema( + id: 9, name: r'otherData', type: IsarType.string, ), r'outputs': PropertySchema( - id: 9, + id: 10, name: r'outputs', type: IsarType.objectList, target: r'Output', ), r'slateId': PropertySchema( - id: 10, + id: 11, name: r'slateId', type: IsarType.string, ), r'subType': PropertySchema( - id: 11, + id: 12, name: r'subType', type: IsarType.byte, enumMap: _TransactionsubTypeEnumValueMap, ), r'timestamp': PropertySchema( - id: 12, + id: 13, name: r'timestamp', type: IsarType.long, ), r'txid': PropertySchema( - id: 13, + id: 14, name: r'txid', type: IsarType.string, ), r'type': PropertySchema( - id: 14, + id: 15, name: r'type', type: IsarType.byte, enumMap: _TransactiontypeEnumValueMap, ), r'walletId': PropertySchema( - id: 15, + id: 16, name: r'walletId', type: IsarType.string, ) @@ -233,19 +238,20 @@ void _transactionSerialize( writer.writeBool(offsets[5], object.isCancelled); writer.writeBool(offsets[6], object.isLelantus); writer.writeLong(offsets[7], object.nonce); - writer.writeString(offsets[8], object.otherData); + writer.writeLong(offsets[8], object.numberOfMessages); + writer.writeString(offsets[9], object.otherData); writer.writeObjectList( - offsets[9], + offsets[10], allOffsets, OutputSchema.serialize, object.outputs, ); - writer.writeString(offsets[10], object.slateId); - writer.writeByte(offsets[11], object.subType.index); - writer.writeLong(offsets[12], object.timestamp); - writer.writeString(offsets[13], object.txid); - writer.writeByte(offsets[14], object.type.index); - writer.writeString(offsets[15], object.walletId); + writer.writeString(offsets[11], object.slateId); + writer.writeByte(offsets[12], object.subType.index); + writer.writeLong(offsets[13], object.timestamp); + writer.writeString(offsets[14], object.txid); + writer.writeByte(offsets[15], object.type.index); + writer.writeString(offsets[16], object.walletId); } Transaction _transactionDeserialize( @@ -269,23 +275,24 @@ Transaction _transactionDeserialize( isCancelled: reader.readBool(offsets[5]), isLelantus: reader.readBoolOrNull(offsets[6]), nonce: reader.readLongOrNull(offsets[7]), - otherData: reader.readStringOrNull(offsets[8]), + numberOfMessages: reader.readLongOrNull(offsets[8]), + otherData: reader.readStringOrNull(offsets[9]), outputs: reader.readObjectList( - offsets[9], + offsets[10], OutputSchema.deserialize, allOffsets, Output(), ) ?? [], - slateId: reader.readStringOrNull(offsets[10]), + slateId: reader.readStringOrNull(offsets[11]), subType: - _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[11])] ?? + _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[12])] ?? TransactionSubType.none, - timestamp: reader.readLong(offsets[12]), - txid: reader.readString(offsets[13]), - type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[14])] ?? + timestamp: reader.readLong(offsets[13]), + txid: reader.readString(offsets[14]), + type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[15])] ?? TransactionType.outgoing, - walletId: reader.readString(offsets[15]), + walletId: reader.readString(offsets[16]), ); object.id = id; return object; @@ -321,8 +328,10 @@ P _transactionDeserializeProp

( case 7: return (reader.readLongOrNull(offset)) as P; case 8: - return (reader.readStringOrNull(offset)) as P; + return (reader.readLongOrNull(offset)) as P; case 9: + return (reader.readStringOrNull(offset)) as P; + case 10: return (reader.readObjectList( offset, OutputSchema.deserialize, @@ -330,19 +339,19 @@ P _transactionDeserializeProp

( Output(), ) ?? []) as P; - case 10: - return (reader.readStringOrNull(offset)) as P; case 11: + return (reader.readStringOrNull(offset)) as P; + case 12: return (_TransactionsubTypeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionSubType.none) as P; - case 12: - return (reader.readLong(offset)) as P; case 13: - return (reader.readString(offset)) as P; + return (reader.readLong(offset)) as P; case 14: + return (reader.readString(offset)) as P; + case 15: return (_TransactiontypeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionType.outgoing) as P; - case 15: + case 16: return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); @@ -1374,6 +1383,80 @@ extension TransactionQueryFilter }); } + QueryBuilder + numberOfMessagesIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'numberOfMessages', + )); + }); + } + + QueryBuilder + numberOfMessagesIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'numberOfMessages', + )); + }); + } + + QueryBuilder + numberOfMessagesEqualTo(int? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesGreaterThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesLessThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesBetween( + int? lower, + int? upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'numberOfMessages', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + QueryBuilder otherDataIsNull() { return QueryBuilder.apply(this, (query) { @@ -2320,6 +2403,20 @@ extension TransactionQuerySortBy }); } + QueryBuilder + sortByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.asc); + }); + } + + QueryBuilder + sortByNumberOfMessagesDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.desc); + }); + } + QueryBuilder sortByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -2504,6 +2601,20 @@ extension TransactionQuerySortThenBy }); } + QueryBuilder + thenByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.asc); + }); + } + + QueryBuilder + thenByNumberOfMessagesDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.desc); + }); + } + QueryBuilder thenByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -2634,6 +2745,13 @@ extension TransactionQueryWhereDistinct }); } + QueryBuilder + distinctByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'numberOfMessages'); + }); + } + QueryBuilder distinctByOtherData( {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { @@ -2737,6 +2855,12 @@ extension TransactionQueryProperty }); } + QueryBuilder numberOfMessagesProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'numberOfMessages'); + }); + } + QueryBuilder otherDataProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'otherData'); diff --git a/lib/models/paymint/transactions_model.dart b/lib/models/paymint/transactions_model.dart index cee48b8eb..4982f1ec1 100644 --- a/lib/models/paymint/transactions_model.dart +++ b/lib/models/paymint/transactions_model.dart @@ -155,6 +155,9 @@ class Transaction { // @HiveField(18) final String? otherData; + // @HiveField(16) + final int? numberOfMessages; + Transaction({ required this.txid, required this.confirmedStatus, @@ -176,6 +179,7 @@ class Transaction { this.isCancelled = false, this.slateId, this.otherData, + this.numberOfMessages, }); factory Transaction.fromJson(Map json) { @@ -211,6 +215,7 @@ class Transaction { isCancelled: json["isCancelled"] as bool? ?? false, slateId: json["slateId"] as String?, otherData: json["otherData"] as String?, + numberOfMessages: json["numberOfMessages"] as int?, ); } @@ -269,6 +274,7 @@ class Transaction { bool? isCancelled, String? slateId, String? otherData, + int? numberOfMessages, }) { return Transaction( txid: txid ?? this.txid, @@ -292,13 +298,14 @@ class Transaction { isCancelled: isCancelled ?? this.isCancelled, slateId: slateId ?? this.slateId, otherData: otherData ?? this.otherData, + numberOfMessages: numberOfMessages ?? this.numberOfMessages, ); } @override String toString() { String transaction = - "{txid: $txid, type: $txType, subType: $subType, value: $amount, fee: $fees, height: $height, confirm: $confirmedStatus, confirmations: $confirmations, address: $address, timestamp: $timestamp, worthNow: $worthNow, inputs: $inputs, slateid: $slateId }"; + "{txid: $txid, type: $txType, subType: $subType, value: $amount, fee: $fees, height: $height, confirm: $confirmedStatus, confirmations: $confirmations, address: $address, timestamp: $timestamp, worthNow: $worthNow, inputs: $inputs, slateid: $slateId, numberOfMessages: $numberOfMessages }"; return transaction; } } diff --git a/lib/pages/wallet_view/sub_widgets/transactions_list.dart b/lib/pages/wallet_view/sub_widgets/transactions_list.dart index e68b443ed..559906af7 100644 --- a/lib/pages/wallet_view/sub_widgets/transactions_list.dart +++ b/lib/pages/wallet_view/sub_widgets/transactions_list.dart @@ -93,12 +93,7 @@ class _TransactionsListState extends ConsumerState { children: [ TransactionCard( // this may mess with combined firo transactions - key: isConfirmed - ? Key(tx.txid + - tx.type.name + - tx.address.value.toString() + - tx.height.toString()) - : UniqueKey(), // + key: UniqueKey(), // transaction: tx, walletId: widget.walletId, ), @@ -193,12 +188,7 @@ class _TransactionsListState extends ConsumerState { ), child: TransactionCard( // this may mess with combined firo transactions - key: isConfirmed - ? Key(tx.txid + - tx.type.name + - tx.address.value.toString() + - tx.height.toString()) - : UniqueKey(), + key: UniqueKey(), transaction: tx, walletId: widget.walletId, ), diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index 3894a3b9c..a6f48c994 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -128,6 +128,37 @@ class _TransactionDetailsViewState } } + if (coin == Coin.epicCash) { + if (_transaction.isCancelled) { + return "Cancelled"; + } else if (type == TransactionType.incoming) { + if (tx.isConfirmed(height, coin.requiredConfirmations)) { + return "Received"; + } else { + if (_transaction.numberOfMessages == 1) { + return "Receiving (waiting for sender)"; + } else if ((_transaction.numberOfMessages ?? 0) > 1) { + return + "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no) + } else { + return "Receiving"; + } + } + } else if (type == TransactionType.outgoing) { + if (tx.isConfirmed(height, coin.requiredConfirmations)) { + return "Sent (confirmed)"; + } else { + if (_transaction.numberOfMessages == 1) { + return "Sending (waiting for receiver)"; + } else if ((_transaction.numberOfMessages ?? 0) > 1) { + return "Sending (waiting for confirmations)"; + } else { + return "Sending"; + } + } + } + } + if (type == TransactionType.incoming) { // if (_transaction.isMinting) { // return "Minting"; diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index 90cd1339a..8c0c5511f 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -1293,6 +1293,7 @@ class BitcoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index bb7deb50b..1f6f5ecf4 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -1158,6 +1158,7 @@ class BitcoinCashWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -2142,6 +2143,7 @@ class BitcoinCashWallet extends CoinServiceAPI nonce: null, inputs: inputs, outputs: outputs, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); diff --git a/lib/services/coins/dogecoin/dogecoin_wallet.dart b/lib/services/coins/dogecoin/dogecoin_wallet.dart index fe0cb5751..cf0ab8944 100644 --- a/lib/services/coins/dogecoin/dogecoin_wallet.dart +++ b/lib/services/coins/dogecoin/dogecoin_wallet.dart @@ -1145,6 +1145,7 @@ class DogecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/ecash/ecash_wallet.dart b/lib/services/coins/ecash/ecash_wallet.dart index f2ee64632..7161011b9 100644 --- a/lib/services/coins/ecash/ecash_wallet.dart +++ b/lib/services/coins/ecash/ecash_wallet.dart @@ -1365,6 +1365,7 @@ class ECashWallet extends CoinServiceAPI nonce: null, inputs: inputs, outputs: outputs, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); @@ -2775,6 +2776,7 @@ class ECashWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index 043c01770..635bfd01e 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -1153,10 +1153,6 @@ class EpicCashWallet extends CoinServiceAPI Future startScans() async { try { if (ListenerManager.pointer != null) { - Logging.instance - .log("LISTENER HANDLER IS NOT NULL ....", level: LogLevel.Info); - Logging.instance - .log("STOPPING ANY WALLET LISTENER ....", level: LogLevel.Info); epicboxListenerStop(ListenerManager.pointer!); } @@ -1648,7 +1644,7 @@ class EpicCashWallet extends CoinServiceAPI Future _refreshTransactions() async { // final currentChainHeight = await chainHeight; final wallet = await _secureStore.read(key: '${_walletId}_wallet'); - const refreshFromNode = 0; + const refreshFromNode = 1; dynamic message; await m.protect(() async { @@ -1714,6 +1710,7 @@ class EpicCashWallet extends CoinServiceAPI ?[tx["tx_type"] == "TxReceived" ? "from" : "to"] as String? ?? ""; String? commitId = slatesToCommits[slateId]?['commitId'] as String?; + tx['numberOfMessages'] = tx['messages']?['messages']?.length; int? height; @@ -1726,6 +1723,7 @@ class EpicCashWallet extends CoinServiceAPI final isIncoming = (tx["tx_type"] == "TxReceived" || tx["tx_type"] == "TxReceivedCancelled"); + final txn = isar_models.Transaction( walletId: walletId, txid: commitId ?? tx["id"].toString(), @@ -1749,6 +1747,7 @@ class EpicCashWallet extends CoinServiceAPI otherData: tx["id"].toString(), inputs: [], outputs: [], + numberOfMessages: ((tx["numberOfMessages"] == null) ? 0 : tx["numberOfMessages"]) as int, ); // txn.address = diff --git a/lib/services/coins/ethereum/ethereum_wallet.dart b/lib/services/coins/ethereum/ethereum_wallet.dart index 2052ead4b..5ea669b7a 100644 --- a/lib/services/coins/ethereum/ethereum_wallet.dart +++ b/lib/services/coins/ethereum/ethereum_wallet.dart @@ -944,6 +944,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { response.value?.nonce.toBigIntFromHex.toInt(), inputs: [], outputs: [], + numberOfMessages: null, ); Address? address = await db.getAddress( @@ -1035,6 +1036,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: tuple.item2, inputs: [], outputs: [], + numberOfMessages: null, ); Address? transactionAddress = await db diff --git a/lib/services/coins/firo/firo_wallet.dart b/lib/services/coins/firo/firo_wallet.dart index 1287fc237..a881db575 100644 --- a/lib/services/coins/firo/firo_wallet.dart +++ b/lib/services/coins/firo/firo_wallet.dart @@ -449,6 +449,7 @@ Future> staticProcessRestore( nonce: null, inputs: element.inputs, outputs: element.outputs, + numberOfMessages: null, )..address.value = element.address.value; } }); @@ -891,6 +892,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -3038,6 +3040,7 @@ class FiroWallet extends CoinServiceAPI otherData: transactionInfo["otherData"] as String?, inputs: [], outputs: [], + numberOfMessages: null, ); final transactionAddress = await db @@ -3518,6 +3521,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(tx, null)); @@ -3640,6 +3644,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); txnsData.add(Tuple2(tx, transactionAddress)); @@ -3791,6 +3796,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); txnsData.add(Tuple2(tx, transactionAddress)); @@ -5069,6 +5075,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = await db diff --git a/lib/services/coins/litecoin/litecoin_wallet.dart b/lib/services/coins/litecoin/litecoin_wallet.dart index 4acbbf1c3..85c3ec91c 100644 --- a/lib/services/coins/litecoin/litecoin_wallet.dart +++ b/lib/services/coins/litecoin/litecoin_wallet.dart @@ -1276,6 +1276,7 @@ class LitecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/monero/monero_wallet.dart b/lib/services/coins/monero/monero_wallet.dart index 29debe753..248f60b84 100644 --- a/lib/services/coins/monero/monero_wallet.dart +++ b/lib/services/coins/monero/monero_wallet.dart @@ -954,6 +954,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(txn, address)); diff --git a/lib/services/coins/namecoin/namecoin_wallet.dart b/lib/services/coins/namecoin/namecoin_wallet.dart index 41122a84b..c2bd4c3a5 100644 --- a/lib/services/coins/namecoin/namecoin_wallet.dart +++ b/lib/services/coins/namecoin/namecoin_wallet.dart @@ -1265,6 +1265,7 @@ class NamecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/particl/particl_wallet.dart b/lib/services/coins/particl/particl_wallet.dart index 83d8d55ec..91f7a68ab 100644 --- a/lib/services/coins/particl/particl_wallet.dart +++ b/lib/services/coins/particl/particl_wallet.dart @@ -1193,6 +1193,7 @@ class ParticlWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -2396,6 +2397,7 @@ class ParticlWallet extends CoinServiceAPI nonce: null, slateId: null, otherData: null, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); diff --git a/lib/services/coins/wownero/wownero_wallet.dart b/lib/services/coins/wownero/wownero_wallet.dart index c07582fa5..71b6bc295 100644 --- a/lib/services/coins/wownero/wownero_wallet.dart +++ b/lib/services/coins/wownero/wownero_wallet.dart @@ -1041,6 +1041,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(txn, address)); diff --git a/lib/services/ethereum/ethereum_token_service.dart b/lib/services/ethereum/ethereum_token_service.dart index c7007c905..f9faf1859 100644 --- a/lib/services/ethereum/ethereum_token_service.dart +++ b/lib/services/ethereum/ethereum_token_service.dart @@ -169,6 +169,7 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache { response.value?.nonce.toBigIntFromHex.toInt(), inputs: [], outputs: [], + numberOfMessages: null, ); Address? address = await ethWallet.db.getAddress( @@ -519,6 +520,7 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache { otherData: tuple.item1.address, inputs: [], outputs: [], + numberOfMessages: null, ); Address? transactionAddress = await ethWallet.db diff --git a/lib/services/mixins/electrum_x_parsing.dart b/lib/services/mixins/electrum_x_parsing.dart index 92cf86305..2827690c5 100644 --- a/lib/services/mixins/electrum_x_parsing.dart +++ b/lib/services/mixins/electrum_x_parsing.dart @@ -258,6 +258,7 @@ mixin ElectrumXParsing { nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); return Tuple2(tx, transactionAddress); diff --git a/lib/utilities/db_version_migration.dart b/lib/utilities/db_version_migration.dart index a83ea4305..c07ed5438 100644 --- a/lib/utilities/db_version_migration.dart +++ b/lib/utilities/db_version_migration.dart @@ -397,6 +397,7 @@ class DbVersionMigrator with WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: tx.numberOfMessages, ); if (tx.address.isEmpty) { diff --git a/pubspec.yaml b/pubspec.yaml index dc1ffb1fa..08c5ea11a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Stack Wallet # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.7.11+175 +version: 1.7.11+176 environment: sdk: ">=2.17.0 <3.0.0" diff --git a/test/json_rpc_test.dart b/test/json_rpc_test.dart index ea6b214be..1c7cc4a00 100644 --- a/test/json_rpc_test.dart +++ b/test/json_rpc_test.dart @@ -17,7 +17,7 @@ void main() { '{"jsonrpc": "2.0", "id": "some id","method": "server.ping","params": []}'; final result = await jsonRPC.request(jsonRequestString); - expect(result, {"jsonrpc": "2.0", "result": null, "id": "some id"}); + expect(result.data, {"jsonrpc": "2.0", "result": null, "id": "some id"}); }); test("JsonRPC.request fails due to SocketException", () async { diff --git a/test/models/transactions_model_test.dart b/test/models/transactions_model_test.dart index 1e19f769a..7547d03fe 100644 --- a/test/models/transactions_model_test.dart +++ b/test/models/transactions_model_test.dart @@ -143,7 +143,7 @@ void main() { ] }); expect(txChunk.toString(), - "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId } \n]"); + "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId, numberOfMessages: null } \n]"); }); }); diff --git a/test/services/coins/firo/firo_wallet_test.dart b/test/services/coins/firo/firo_wallet_test.dart index 766df279f..68db15437 100644 --- a/test/services/coins/firo/firo_wallet_test.dart +++ b/test/services/coins/firo/firo_wallet_test.dart @@ -105,6 +105,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ), ) .toList(); diff --git a/test/services/coins/manager_test.dart b/test/services/coins/manager_test.dart index 65a2de918..fcc246882 100644 --- a/test/services/coins/manager_test.dart +++ b/test/services/coins/manager_test.dart @@ -126,6 +126,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); when(wallet.transactions).thenAnswer((_) async => [ tx, diff --git a/test/widget_tests/transaction_card_test.dart b/test/widget_tests/transaction_card_test.dart index fcad532fa..d3d16b655 100644 --- a/test/widget_tests/transaction_card_test.dart +++ b/test/widget_tests/transaction_card_test.dart @@ -71,6 +71,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -188,6 +189,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -302,6 +304,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -410,6 +413,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "",