xclud / web3dart

Ethereum library, written in Dart.
https://pub.dev/packages/web3dart
MIT License
170 stars 94 forks source link

int? chainId = 1, causing the sender to be always invalid sender #127

Open venbrinoDev opened 8 months ago

venbrinoDev commented 8 months ago

ERROR Error RPCError: got code -32000 with msg "invalid sender".

Future sendTransaction( Credentials cred, Transaction transaction, { int? chainId = 1, bool fetchChainIdFromNetworkId = false, })

Chain id is supposed to be fetch from the networkId or chainId method But its always 1

FIX Future sendTransaction( Credentials cred, Transaction transaction, { int? chainId , bool fetchChainIdFromNetworkId = false, })

Chain id is left as null here so it always fetch from network

Environment Dart SDK version: 3.1.3 (stable)

xclud commented 8 months ago

Thanks for reporting. I will investigate reverting a commit causing this bug. Meanwhile passing chainId: null will fix your problem.

venbrinoDev commented 8 months ago

I don't think passing chain id =null fix the problem

As chain Id will still return 1

therefor it won't be gotten from the network