@@ -170,12 +170,11 @@ class DbVersionMigrator with WalletDB {
170170 final count = await MainDB .instance.isar.addresses.count ();
171171 // add change/receiving tags to address labels
172172 for (var i = 0 ; i < count; i += 50 ) {
173- final addresses =
174- await MainDB .instance.isar.addresses
175- .where ()
176- .offset (i)
177- .limit (50 )
178- .findAll ();
173+ final addresses = await MainDB .instance.isar.addresses
174+ .where ()
175+ .offset (i)
176+ .limit (50 )
177+ .findAll ();
179178
180179 final List <isar_models.AddressLabel > labels = [];
181180 for (final address in addresses) {
@@ -203,14 +202,13 @@ class DbVersionMigrator with WalletDB {
203202
204203 // update/create label if tags is not empty
205204 if (tags != null ) {
206- isar_models.AddressLabel ? label =
207- await MainDB .instance.isar.addressLabels
208- .where ()
209- .addressStringWalletIdEqualTo (
210- address.value,
211- address.walletId,
212- )
213- .findFirst ();
205+ isar_models.AddressLabel ? label = await MainDB
206+ .instance
207+ .isar
208+ .addressLabels
209+ .where ()
210+ .addressStringWalletIdEqualTo (address.value, address.walletId)
211+ .findFirst ();
214212 if (label == null ) {
215213 label = isar_models.AddressLabel (
216214 walletId: address.walletId,
@@ -268,13 +266,12 @@ class DbVersionMigrator with WalletDB {
268266 Bitcoincash (CryptoCurrencyNetwork .main).identifier ||
269267 info.coinIdentifier ==
270268 Bitcoincash (CryptoCurrencyNetwork .test).identifier) {
271- final ids =
272- await MainDB .instance
273- .getAddresses (walletId)
274- .filter ()
275- .typeEqualTo (isar_models.AddressType .p2sh)
276- .idProperty ()
277- .findAll ();
269+ final ids = await MainDB .instance
270+ .getAddresses (walletId)
271+ .filter ()
272+ .typeEqualTo (isar_models.AddressType .p2sh)
273+ .idProperty ()
274+ .findAll ();
278275
279276 await MainDB .instance.isar.writeTxn (() async {
280277 await MainDB .instance.isar.addresses.deleteAll (ids);
@@ -421,17 +418,15 @@ class DbVersionMigrator with WalletDB {
421418 walletId: walletId,
422419 txid: tx.txid,
423420 timestamp: tx.timestamp,
424- type:
425- isIncoming
426- ? isar_models.TransactionType .incoming
427- : isar_models.TransactionType .outgoing,
421+ type: isIncoming
422+ ? isar_models.TransactionType .incoming
423+ : isar_models.TransactionType .outgoing,
428424 subType: isar_models.TransactionSubType .none,
429425 amount: tx.amount,
430- amountString:
431- Amount (
432- rawValue: BigInt .from (tx.amount),
433- fractionDigits: epic.fractionDigits,
434- ).toJsonString (),
426+ amountString: Amount (
427+ rawValue: BigInt .from (tx.amount),
428+ fractionDigits: epic.fractionDigits,
429+ ).toJsonString (),
435430 fee: tx.fees,
436431 height: tx.height,
437432 isCancelled: tx.isCancelled,
@@ -453,14 +448,12 @@ class DbVersionMigrator with WalletDB {
453448 publicKey: [],
454449 derivationIndex: isIncoming ? rcvIndex : - 1 ,
455450 derivationPath: null ,
456- type:
457- isIncoming
458- ? isar_models.AddressType .mimbleWimble
459- : isar_models.AddressType .unknown,
460- subType:
461- isIncoming
462- ? isar_models.AddressSubType .receiving
463- : isar_models.AddressSubType .unknown,
451+ type: isIncoming
452+ ? isar_models.AddressType .mimbleWimble
453+ : isar_models.AddressType .unknown,
454+ subType: isIncoming
455+ ? isar_models.AddressSubType .receiving
456+ : isar_models.AddressSubType .unknown,
464457 );
465458 transactionsData.add (Tuple2 (iTx, address));
466459 }
@@ -518,28 +511,25 @@ class DbVersionMigrator with WalletDB {
518511 final crypto = AppConfig .getCryptoCurrencyFor (info.coinIdentifier)! ;
519512
520513 for (var i = 0 ; i < count; i += 50 ) {
521- final txns =
522- await MainDB .instance
523- .getTransactions (walletId)
524- .offset (i)
525- .limit (50 )
526- .findAll ();
514+ final txns = await MainDB .instance
515+ .getTransactions (walletId)
516+ .offset (i)
517+ .limit (50 )
518+ .findAll ();
527519
528520 // migrate amount to serialized amount string
529- final txnsData =
530- txns
531- .map (
532- (tx) => Tuple2 (
533- tx
534- ..amountString =
535- Amount (
536- rawValue: BigInt .from (tx.amount),
537- fractionDigits: crypto.fractionDigits,
538- ).toJsonString (),
539- tx.address.value,
540- ),
541- )
542- .toList ();
521+ final txnsData = txns
522+ .map (
523+ (tx) => Tuple2 (
524+ tx
525+ ..amountString = Amount (
526+ rawValue: BigInt .from (tx.amount),
527+ fractionDigits: crypto.fractionDigits,
528+ ).toJsonString (),
529+ tx.address.value,
530+ ),
531+ )
532+ .toList ();
543533
544534 // update db records
545535 await MainDB .instance.addNewTransactionData (txnsData, walletId);
0 commit comments