Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method eth_estimate_gas used in SDK example raises ValueError #53

Open
Humble255 opened this issue Apr 1, 2023 · 0 comments
Open

Method eth_estimate_gas used in SDK example raises ValueError #53

Humble255 opened this issue Apr 1, 2023 · 0 comments

Comments

@Humble255
Copy link

Humble255 commented Apr 1, 2023

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=chain_id,
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 field gasPerPubdata.'}

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

No branches or pull requests

1 participant