zksync-sdk / zksync-python

Python 3.8 SDK for zkSync
MIT License
116 stars 64 forks source link

Method eth_estimate_gas used in SDK example raises ValueError #53

Open Humble255 opened 1 year ago

Humble255 commented 1 year ago

Using Python SDK example transaction function I have encontered problem with eth_estimate_gas method, it raises exception. It was chcecked on Era mainnet using existing valid addresses.

` tx_func_call = TxFunctionCall(chain_id=chainid, nonce=nonce, from=from_account.address, to=to_account.address, value=Web3.toWei(amount_eth, 'ether'), data=HexStr("0x"), gas_limit=0, # unknown at this state, will be replaced by estimate_gas gas_price=gas_price, max_priority_fee_per_gas=100000000 )

estimate_gas = zksync_web3.zksync.eth_estimate_gas(tx_func_call.tx)`

Traceback:

Traceback (most recent call last): File "D:\GIT\Python\zkSync\main.py", line 113, in <module> transfer_eth_(amount_eth=0.001,from_account=MAIN_ACCOUNT, to_account=ACC1_ACCOUNT) File "D:\GIT\Python\zkSync\main.py", line 78, in transfer_eth_ estimate_gas = zksync_web3.zksync.eth_estimate_gas(tx_func_call.tx) File "D:\GIT\Python\zkSync\venv\lib\site-packages\zksync2\module\zksync_module.py", line 284, in eth_estimate_gas return self._eth_estimate_gas(tx) File "D:\GIT\Python\zkSync\venv\lib\site-packages\web3\module.py", line 57, in caller result = w3.manager.request_blocking(method_str, File "D:\GIT\Python\zkSync\venv\lib\site-packages\web3\manager.py", line 198, in request_blocking return self.formatted_response(response, File "D:\GIT\Python\zkSync\venv\lib\site-packages\web3\manager.py", line 171, in formatted_response raise ValueError(response["error"]) ValueError: {'code': -32602, 'message': 'Invalid params: missing fieldgasPerPubdata.'}