We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to read data from a substrate chain (Jupiter A1 testnet), I got this error:
Traceback (most recent call last): File "shibuya_interface.py", line 31, in <module> result = contract.read(keypair, 'get') File "/home/minhnd/anaconda3/lib/python3.8/site-packages/substrateinterface/contracts.py", line 796, in read contract_exec_result.gas_required = response['result']['gasRequired'] KeyError: 'gasRequired'
This is my code:
from substrateinterface import Keypair substrate = SubstrateInterface( url="wss://ws.jupiter-poa.patract.cn/", ss58_format=42 ) contract = ContractInstance.create_from_address( contract_address="3g2kZxvk8XT8XLoDgJHYuNnEPN1t6yfP8vFj4jgxSWrUxGqJ", metadata_file="./flipper_metadata.json", substrate=substrate ) keypair = Keypair.create_from_mnemonic("my secret phrase") result = contract.read(keypair, 'get') print('Current value of "get":', result.contract_result_data) print(result)
This file runs perfectly on a substrate node template on my computer.
The text was updated successfully, but these errors were encountered:
I hardcoded a value for the gas_required in the contracts.py and it did temporarily fix the problem.
gas_required
contracts.py
Sorry, something went wrong.
No branches or pull requests
I'm trying to read data from a substrate chain (Jupiter A1 testnet), I got this error:
This is my code:
This file runs perfectly on a substrate node template on my computer.
The text was updated successfully, but these errors were encountered: