fix: polygon wallet service

This commit is contained in:
Rafael Saes 2023-12-13 17:04:59 -03:00
parent 8627698416
commit a2b67374c1

View file

@ -19,7 +19,7 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
final Box<WalletInfo> walletInfoSource; final Box<WalletInfo> walletInfoSource;
@override @override
Future<PolygonWallet> create(PolygonNewWalletCredentials credentials) async { Future<PolygonWallet> create(PolygonNewWalletCredentials credentials, {bool? isTestnet}) async {
final strength = (credentials.seedPhraseLength == 12) final strength = (credentials.seedPhraseLength == 12)
? 128 ? 128
: (credentials.seedPhraseLength == 24) : (credentials.seedPhraseLength == 24)
@ -72,7 +72,8 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
} }
@override @override
Future<PolygonWallet> restoreFromKeys(PolygonRestoreWalletFromPrivateKey credentials) async { Future<PolygonWallet> restoreFromKeys(PolygonRestoreWalletFromPrivateKey credentials,
{bool? isTestnet}) async {
final wallet = PolygonWallet( final wallet = PolygonWallet(
password: credentials.password!, password: credentials.password!,
privateKey: credentials.privateKey, privateKey: credentials.privateKey,
@ -87,7 +88,8 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
} }
@override @override
Future<PolygonWallet> restoreFromSeed(PolygonRestoreWalletFromSeedCredentials credentials) async { Future<PolygonWallet> restoreFromSeed(PolygonRestoreWalletFromSeedCredentials credentials,
{bool? isTestnet}) async {
if (!bip39.validateMnemonic(credentials.mnemonic)) { if (!bip39.validateMnemonic(credentials.mnemonic)) {
throw EthereumMnemonicIsIncorrectException(); throw EthereumMnemonicIsIncorrectException();
} }