mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-12 09:27:01 +00:00
remove useless walletId param from db init
This commit is contained in:
parent
daa2648763
commit
8921302ee0
20 changed files with 45 additions and 45 deletions
|
@ -659,7 +659,7 @@ class BitcoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
p2wpkhChangeAddressArray.add(address);
|
||||
}
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
...p2wpkhReceiveAddressArray,
|
||||
|
@ -1164,7 +1164,7 @@ class BitcoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
}
|
||||
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
}
|
||||
|
||||
// hack to add tx to txData before refresh completes
|
||||
|
|
|
@ -604,7 +604,7 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
p2shChangeAddressArray.add(address);
|
||||
}
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
...p2pkhReceiveAddressArray,
|
||||
|
@ -1094,7 +1094,7 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
}
|
||||
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
}
|
||||
|
||||
// hack to add tx to txData before refresh completes
|
||||
|
@ -1372,7 +1372,7 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
_generateAddressForChain(1, 0, DerivePathType.bip49),
|
||||
]);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses(initialAddresses);
|
||||
|
||||
|
|
|
@ -519,7 +519,7 @@ class DogecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
p2pkhChangeAddressArray.add(address);
|
||||
}
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
...p2pkhReceiveAddressArray,
|
||||
|
@ -999,7 +999,7 @@ class DogecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
}
|
||||
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
}
|
||||
|
||||
// hack to add tx to txData before refresh completes
|
||||
|
@ -1234,7 +1234,7 @@ class DogecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
final initialChangeAddressP2PKH =
|
||||
await _generateAddressForChain(1, 0, DerivePathType.bip44);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
initialReceivingAddressP2PKH,
|
||||
|
|
|
@ -969,7 +969,7 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
Logging.instance.log("Opening existing ${coin.prettyName} wallet",
|
||||
level: LogLevel.Info);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
final config = await getRealConfig();
|
||||
final password = await _secureStore.read(key: '${_walletId}_password');
|
||||
|
||||
|
@ -1039,7 +1039,7 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
String stringConfig = await getConfig();
|
||||
String epicboxConfig = await getEpicBoxConfig();
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await _secureStore.write(
|
||||
key: '${_walletId}_mnemonic', value: mnemonicString);
|
||||
|
@ -1081,7 +1081,7 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
epicUpdateChangeIndex(0),
|
||||
]);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
final initialReceivingAddress = await _getReceivingAddressForIndex(0);
|
||||
|
||||
await db.putAddress(initialReceivingAddress);
|
||||
|
|
|
@ -1828,7 +1828,7 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||
}
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
}
|
||||
|
||||
Future<bool> refreshIfThereIsNewData() async {
|
||||
|
@ -2099,7 +2099,7 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
final initialReceivingAddress = await _generateAddressForChain(0, 0);
|
||||
final initialChangeAddress = await _generateAddressForChain(1, 0);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
initialReceivingAddress,
|
||||
|
@ -4292,7 +4292,7 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
Logging.instance
|
||||
.log("PROCESSORS ${Platform.numberOfProcessors}", level: LogLevel.Info);
|
||||
try {
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
final latestSetId = await getLatestSetId();
|
||||
final setDataMap = getSetDataMap(latestSetId);
|
||||
|
|
|
@ -677,7 +677,7 @@ class LitecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
p2wpkhChangeAddressArray.add(address);
|
||||
}
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
...p2wpkhReceiveAddressArray,
|
||||
|
@ -1182,7 +1182,7 @@ class LitecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||
}
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
}
|
||||
|
||||
// hack to add tx to txData before refresh completes
|
||||
|
@ -1473,7 +1473,7 @@ class LitecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
_generateAddressForChain(1, 0, DerivePathType.bip49),
|
||||
]);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses(initialAddresses);
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
keysStorage = KeyService(_secureStorage);
|
||||
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
// final data =
|
||||
// DB.instance.get<dynamic>(boxName: walletId, key: "latest_tx_model")
|
||||
// as TransactionData?;
|
||||
|
@ -389,7 +389,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
// Generate and add addresses to relevant arrays
|
||||
final initialReceivingAddress = await _generateAddressForChain(0, 0);
|
||||
// final initialChangeAddress = await _generateAddressForChain(1, 0);
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddress(initialReceivingAddress);
|
||||
|
||||
|
|
|
@ -667,7 +667,7 @@ class NamecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
p2wpkhChangeAddressArray.add(address);
|
||||
}
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
...p2wpkhReceiveAddressArray,
|
||||
|
@ -1171,7 +1171,7 @@ class NamecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||
}
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
}
|
||||
|
||||
// hack to add tx to txData before refresh completes
|
||||
|
@ -1450,7 +1450,7 @@ class NamecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
_generateAddressForChain(1, 0, DerivePathType.bip49),
|
||||
]);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses(initialAddresses);
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
p2wpkhChangeAddressArray.add(address);
|
||||
}
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses([
|
||||
...p2wpkhReceiveAddressArray,
|
||||
|
@ -1101,7 +1101,7 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
"Attempted to initialize an existing wallet using an unknown wallet ID!");
|
||||
}
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
}
|
||||
|
||||
// TODO make sure this copied implementation from bitcoin_wallet.dart applies for particl just as well--or import it
|
||||
|
@ -1364,7 +1364,7 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
_generateAddressForChain(1, 0, DerivePathType.bip44),
|
||||
]);
|
||||
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddresses(initialAddresses);
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
keysStorage = KeyService(_secureStorage);
|
||||
|
||||
await _prefs.init();
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
String? password;
|
||||
try {
|
||||
|
@ -397,7 +397,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
// Generate and add addresses to relevant arrays
|
||||
final initialReceivingAddress = await _generateAddressForChain(0, 0);
|
||||
// final initialChangeAddress = await _generateAddressForChain(1, 0);
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
|
||||
await db.putAddress(initialReceivingAddress);
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:tuple/tuple.dart';
|
|||
mixin WalletDB {
|
||||
MainDB get db => MainDB.instance;
|
||||
|
||||
Future<void> isarInit(String walletId) async {
|
||||
Future<void> isarInit() async {
|
||||
await db.isarInit();
|
||||
}
|
||||
|
||||
|
|
|
@ -403,7 +403,7 @@ class DbVersionMigrator with WalletDB {
|
|||
_parseTransactions(txnsLelantus, walletId, true, newAddresses));
|
||||
|
||||
// store newly parsed data in isar
|
||||
await isarInit(walletId);
|
||||
await isarInit();
|
||||
await db.isar.writeTxn(() async {
|
||||
await db.isar.addresses.putAll(newAddresses);
|
||||
});
|
||||
|
|
|
@ -1558,10 +1558,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i21.BitcoinWallet {
|
|||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
) as _i17.Future<void>);
|
||||
@override
|
||||
_i17.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i17.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i17.Future<void>.value(),
|
||||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
|
|
|
@ -978,10 +978,10 @@ class MockFiroWallet extends _i1.Mock implements _i9.FiroWallet {
|
|||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
@override
|
||||
_i10.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i10.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
|
|
|
@ -1348,10 +1348,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet {
|
|||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
) as _i17.Future<void>);
|
||||
@override
|
||||
_i17.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i17.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i17.Future<void>.value(),
|
||||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
|
|
|
@ -1333,10 +1333,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
|
|||
returnValueForMissingStub: _i16.Future<void>.value(),
|
||||
) as _i16.Future<void>);
|
||||
@override
|
||||
_i16.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i16.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i16.Future<void>.value(),
|
||||
returnValueForMissingStub: _i16.Future<void>.value(),
|
||||
|
|
|
@ -1891,10 +1891,10 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet {
|
|||
returnValueForMissingStub: _i18.Future<void>.value(),
|
||||
) as _i18.Future<void>);
|
||||
@override
|
||||
_i18.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i18.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i18.Future<void>.value(),
|
||||
returnValueForMissingStub: _i18.Future<void>.value(),
|
||||
|
|
|
@ -1096,10 +1096,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i18.BitcoinWallet {
|
|||
returnValueForMissingStub: _i15.Future<void>.value(),
|
||||
) as _i15.Future<void>);
|
||||
@override
|
||||
_i15.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i15.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i15.Future<void>.value(),
|
||||
returnValueForMissingStub: _i15.Future<void>.value(),
|
||||
|
|
|
@ -1347,10 +1347,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet {
|
|||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
) as _i17.Future<void>);
|
||||
@override
|
||||
_i17.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i17.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i17.Future<void>.value(),
|
||||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
|
|
|
@ -1347,10 +1347,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet {
|
|||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
) as _i17.Future<void>);
|
||||
@override
|
||||
_i17.Future<void> isarInit(String? walletId) => (super.noSuchMethod(
|
||||
_i17.Future<void> isarInit() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isarInit,
|
||||
[walletId],
|
||||
[],
|
||||
),
|
||||
returnValue: _i17.Future<void>.value(),
|
||||
returnValueForMissingStub: _i17.Future<void>.value(),
|
||||
|
|
Loading…
Reference in a new issue