Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Unhandled Exception: Invalid argument(s): Client is required to perform network actions #216

Closed
sayhellotogithub opened this issue Nov 5, 2021 · 8 comments

Comments

@sayhellotogithub
Copy link

flutter
environment:
sdk: ">=2.12.0 <3.0.0"

provider: ^6.0.1
web3dart: ^2.3.2
http: ^0.13.4
web_socket_channel: ^2.1.0

====================================================================================================
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Client is required to perform network actions
#0 _fillMissingData (package:web3dart/src/core/transaction_signer.dart:32:5)

#1 Web3Client.signTransaction (package:web3dart/src/core/client.dart:316:26)

#2 Web3Client.sendTransaction (package:web3dart/src/core/client.dart:285:18)

#3 ContractLinking.addData (package:population/contract_linking.dart:98:5)

This if condition have a problem.
`
if (client == null &&
(transaction.nonce == null ||
transaction.maxGas == null ||
loadChainIdFromNetwork) ||
(!transaction.isEIP1559 && gasPrice == null)) {
throw ArgumentError('Client is required to perform network actions');
}

if (!transaction.isEIP1559 && gasPrice == null) {
gasPrice = await client!.getGasPrice();
}
`

@simolus3
Copy link
Owner

simolus3 commented Nov 5, 2021

Can you post your call to sendTransaction? This may be an issue in your code as well.

@sayhellotogithub
Copy link
Author

(!transaction.isEIP1559 && gasPrice == null) this condition is the same with below

if (!transaction.isEIP1559 && gasPrice == null) {
gasPrice = await client!.getGasPrice();
}

so below can't run .

@vinicentus
Copy link
Contributor

I'm getting this as well since upgrade to 2.3.2. The same code works when rolling back to 2.3.1.

@thgehr
Copy link

thgehr commented Nov 9, 2021

I'm getting this as well since upgrade to 2.3.2. The same code works when rolling back to 2.3.1.

Same here, my code works on version 2.3.1 but not on 2.3.2

@tionx3na
Copy link

Any update on this problem?

@ludowkm
Copy link
Contributor

ludowkm commented Nov 10, 2021

The above code snippet is normal because we need the client to retrieve more information for transaction if missing, i used it without any error

@seungbok3240
Copy link

seungbok3240 commented Nov 10, 2021

I'm getting this as well since upgrade to 2.3.2. The same code works when rolling back to 2.3.1.

Same here, my code works on version 2.3.1 but not on 2.3.2

my code do not works on version 2.3.1 and 2.3.2

@vinicentus
Copy link
Contributor

Thank you for the fix @simolus3 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants