mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
CW-802: Ethereum enhancements (#1826)
* fix: Ethereum enhancements around fees and computations relating to signing and sending transactions * feat: Add nownodes key for evm to workflow * feat: Reactivate send all on both eth and polygon wallet types * fix: Add generic function for updating the node for a wallet type, move ethereum transaction error fees handler to a new file * fix: Revert podfile.lock --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
ed600f9b8b
commit
9590aa25b6
40 changed files with 346 additions and 35 deletions
|
@ -289,7 +289,21 @@ Future<void> defaultSettingsMigration(
|
|||
],
|
||||
);
|
||||
break;
|
||||
|
||||
case 45:
|
||||
await updateWalletTypeNodesWithNewNode(
|
||||
newNodeUri: 'matic.nownodes.io',
|
||||
sharedPreferences: sharedPreferences,
|
||||
nodes: nodes,
|
||||
type: WalletType.polygon,
|
||||
useSSL: true,
|
||||
);
|
||||
await updateWalletTypeNodesWithNewNode(
|
||||
newNodeUri: 'eth.nownodes.io',
|
||||
sharedPreferences: sharedPreferences,
|
||||
nodes: nodes,
|
||||
type: WalletType.ethereum,
|
||||
useSSL: true,
|
||||
);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -339,6 +353,26 @@ Future<void> _changeDefaultNode({
|
|||
}
|
||||
}
|
||||
|
||||
/// Generic function for adding a new Node for a Wallet Type.
|
||||
Future<void> updateWalletTypeNodesWithNewNode({
|
||||
required SharedPreferences sharedPreferences,
|
||||
required Box<Node> nodes,
|
||||
required WalletType type,
|
||||
required String newNodeUri,
|
||||
required bool useSSL,
|
||||
}) async {
|
||||
// If it already exists in the box of nodes, no need to add it annymore.
|
||||
if (nodes.values.any((node) => node.uriRaw == newNodeUri)) return;
|
||||
|
||||
await nodes.add(
|
||||
Node(
|
||||
uri: newNodeUri,
|
||||
type: type,
|
||||
useSSL: useSSL,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _updateCakeXmrNode(Box<Node> nodes) async {
|
||||
final node = nodes.values.firstWhereOrNull((element) => element.uriRaw == newCakeWalletMoneroUri);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue