mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
fix: cached electrumx constructor usage
This commit is contained in:
parent
5eec303476
commit
e0e4ffe0f4
9 changed files with 25 additions and 51 deletions
|
@ -1342,16 +1342,14 @@ class BitcoinWallet extends CoinServiceAPI
|
|||
))
|
||||
.toList();
|
||||
final newNode = await getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
|
@ -1234,16 +1234,14 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
))
|
||||
.toList();
|
||||
final newNode = await getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
|
@ -56,17 +56,7 @@ abstract class CoinServiceAPI {
|
|||
prefs: prefs,
|
||||
);
|
||||
final cachedClient = CachedElectrumX.from(
|
||||
node: electrumxNode,
|
||||
failovers: failovers
|
||||
.map((e) => ElectrumXNode(
|
||||
address: e.host,
|
||||
port: e.port,
|
||||
name: e.name,
|
||||
id: e.id,
|
||||
useSSL: e.useSSL,
|
||||
))
|
||||
.toList(),
|
||||
prefs: prefs,
|
||||
electrumXClient: client,
|
||||
);
|
||||
switch (coin) {
|
||||
case Coin.firo:
|
||||
|
|
|
@ -1194,16 +1194,14 @@ class DogecoinWallet extends CoinServiceAPI
|
|||
))
|
||||
.toList();
|
||||
final newNode = await getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
|
@ -410,16 +410,14 @@ class ECashWallet extends CoinServiceAPI
|
|||
))
|
||||
.toList();
|
||||
final newNode = await getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
|
@ -1840,16 +1840,14 @@ class FiroWallet extends CoinServiceAPI
|
|||
)
|
||||
.toList();
|
||||
final newNode = await _getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
|
@ -1325,16 +1325,14 @@ class LitecoinWallet extends CoinServiceAPI
|
|||
))
|
||||
.toList();
|
||||
final newNode = await getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
|
@ -1314,16 +1314,14 @@ class NamecoinWallet extends CoinServiceAPI
|
|||
))
|
||||
.toList();
|
||||
final newNode = await getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
|
@ -1242,16 +1242,14 @@ class ParticlWallet extends CoinServiceAPI
|
|||
))
|
||||
.toList();
|
||||
final newNode = await getCurrentNode();
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_electrumXClient = ElectrumX.from(
|
||||
node: newNode,
|
||||
prefs: _prefs,
|
||||
failovers: failovers,
|
||||
);
|
||||
_cachedElectrumXClient = CachedElectrumX.from(
|
||||
electrumXClient: _electrumXClient,
|
||||
);
|
||||
|
||||
if (shouldRefresh) {
|
||||
unawaited(refresh());
|
||||
|
|
Loading…
Reference in a new issue