From 30d8f8b810b8ba76fdbb2975e861186a002894c0 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 11 Jan 2023 14:47:27 -0600 Subject: [PATCH] update isCancelled flag name to be consistent with other isar model bool values --- .../models/blockchain_data/transaction.dart | 2 +- .../models/blockchain_data/transaction.g.dart | 124 +++++++++--------- .../wallet_view/sub_widgets/tx_icon.dart | 2 +- .../coins/bitcoincash/bitcoincash_wallet.dart | 2 +- lib/widgets/transaction_card.dart | 2 +- 5 files changed, 66 insertions(+), 66 deletions(-) diff --git a/lib/models/isar/models/blockchain_data/transaction.dart b/lib/models/isar/models/blockchain_data/transaction.dart index f19bc2224..7c984b96a 100644 --- a/lib/models/isar/models/blockchain_data/transaction.dart +++ b/lib/models/isar/models/blockchain_data/transaction.dart @@ -34,7 +34,7 @@ class Transaction { late int? height; - late bool cancelled; + late bool isCancelled; late String? slateId; diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart index 9a6849146..42261d9e0 100644 --- a/lib/models/isar/models/blockchain_data/transaction.g.dart +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -27,21 +27,21 @@ const TransactionSchema = CollectionSchema( name: r'amount', type: IsarType.long, ), - r'cancelled': PropertySchema( - id: 2, - name: r'cancelled', - type: IsarType.bool, - ), r'fee': PropertySchema( - id: 3, + id: 2, name: r'fee', type: IsarType.long, ), r'height': PropertySchema( - id: 4, + id: 3, name: r'height', type: IsarType.long, ), + r'isCancelled': PropertySchema( + id: 4, + name: r'isCancelled', + type: IsarType.bool, + ), r'otherData': PropertySchema( id: 5, name: r'otherData', @@ -167,9 +167,9 @@ void _transactionSerialize( ) { writer.writeString(offsets[0], object.address); writer.writeLong(offsets[1], object.amount); - writer.writeBool(offsets[2], object.cancelled); - writer.writeLong(offsets[3], object.fee); - writer.writeLong(offsets[4], object.height); + writer.writeLong(offsets[2], object.fee); + writer.writeLong(offsets[3], object.height); + writer.writeBool(offsets[4], object.isCancelled); writer.writeString(offsets[5], object.otherData); writer.writeString(offsets[6], object.slateId); writer.writeByte(offsets[7], object.subType.index); @@ -187,10 +187,10 @@ Transaction _transactionDeserialize( final object = Transaction(); object.address = reader.readString(offsets[0]); object.amount = reader.readLong(offsets[1]); - object.cancelled = reader.readBool(offsets[2]); - object.fee = reader.readLong(offsets[3]); - object.height = reader.readLongOrNull(offsets[4]); + object.fee = reader.readLong(offsets[2]); + object.height = reader.readLongOrNull(offsets[3]); object.id = id; + object.isCancelled = reader.readBool(offsets[4]); object.otherData = reader.readStringOrNull(offsets[5]); object.slateId = reader.readStringOrNull(offsets[6]); object.subType = @@ -216,11 +216,11 @@ P _transactionDeserializeProp

( case 1: return (reader.readLong(offset)) as P; case 2: - return (reader.readBool(offset)) as P; - case 3: return (reader.readLong(offset)) as P; - case 4: + case 3: return (reader.readLongOrNull(offset)) as P; + case 4: + return (reader.readBool(offset)) as P; case 5: return (reader.readStringOrNull(offset)) as P; case 6: @@ -748,16 +748,6 @@ extension TransactionQueryFilter }); } - QueryBuilder - cancelledEqualTo(bool value) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'cancelled', - value: value, - )); - }); - } - QueryBuilder feeEqualTo( int value) { return QueryBuilder.apply(this, (query) { @@ -935,6 +925,16 @@ extension TransactionQueryFilter }); } + QueryBuilder + isCancelledEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'isCancelled', + value: value, + )); + }); + } + QueryBuilder otherDataIsNull() { return QueryBuilder.apply(this, (query) { @@ -1703,18 +1703,6 @@ extension TransactionQuerySortBy }); } - QueryBuilder sortByCancelled() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'cancelled', Sort.asc); - }); - } - - QueryBuilder sortByCancelledDesc() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'cancelled', Sort.desc); - }); - } - QueryBuilder sortByFee() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'fee', Sort.asc); @@ -1739,6 +1727,18 @@ extension TransactionQuerySortBy }); } + QueryBuilder sortByIsCancelled() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCancelled', Sort.asc); + }); + } + + QueryBuilder sortByIsCancelledDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCancelled', Sort.desc); + }); + } + QueryBuilder sortByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -1838,18 +1838,6 @@ extension TransactionQuerySortThenBy }); } - QueryBuilder thenByCancelled() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'cancelled', Sort.asc); - }); - } - - QueryBuilder thenByCancelledDesc() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'cancelled', Sort.desc); - }); - } - QueryBuilder thenByFee() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'fee', Sort.asc); @@ -1886,6 +1874,18 @@ extension TransactionQuerySortThenBy }); } + QueryBuilder thenByIsCancelled() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCancelled', Sort.asc); + }); + } + + QueryBuilder thenByIsCancelledDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCancelled', Sort.desc); + }); + } + QueryBuilder thenByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -1974,12 +1974,6 @@ extension TransactionQueryWhereDistinct }); } - QueryBuilder distinctByCancelled() { - return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'cancelled'); - }); - } - QueryBuilder distinctByFee() { return QueryBuilder.apply(this, (query) { return query.addDistinctBy(r'fee'); @@ -1992,6 +1986,12 @@ extension TransactionQueryWhereDistinct }); } + QueryBuilder distinctByIsCancelled() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'isCancelled'); + }); + } + QueryBuilder distinctByOtherData( {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { @@ -2052,12 +2052,6 @@ extension TransactionQueryProperty }); } - QueryBuilder cancelledProperty() { - return QueryBuilder.apply(this, (query) { - return query.addPropertyName(r'cancelled'); - }); - } - QueryBuilder feeProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'fee'); @@ -2070,6 +2064,12 @@ extension TransactionQueryProperty }); } + QueryBuilder isCancelledProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'isCancelled'); + }); + } + QueryBuilder otherDataProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'otherData'); diff --git a/lib/pages/wallet_view/sub_widgets/tx_icon.dart b/lib/pages/wallet_view/sub_widgets/tx_icon.dart index 6d96cb279..e0983bd47 100644 --- a/lib/pages/wallet_view/sub_widgets/tx_icon.dart +++ b/lib/pages/wallet_view/sub_widgets/tx_icon.dart @@ -122,7 +122,7 @@ class TxIcon2 extends StatelessWidget { child: Center( child: SvgPicture.asset( _getAssetName( - transaction.cancelled, + transaction.isCancelled, txIsReceived, !transaction.isConfirmed( currentHeight, diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index 15fbca2a1..bd0033614 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -2223,7 +2223,7 @@ class BitcoinCashWallet extends CoinServiceAPI { tx.height = txData["height"] as int?; - tx.cancelled = false; + tx.isCancelled = false; tx.slateId = null; tx.otherData = null; diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index 29139a5a7..531d7abb9 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -452,7 +452,7 @@ class _TransactionCardState2 extends ConsumerState { child: FittedBox( fit: BoxFit.scaleDown, child: Text( - _transaction.cancelled + _transaction.isCancelled ? "Cancelled" : whatIsIt( _transaction.type,