-
Notifications
You must be signed in to change notification settings - Fork 117
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
Contract interactions not supported on Weight V2 chains #334
Comments
Thanks for the compliment :) I haven't given the contract interface much attention recently, so this would be a good opportunity to update to the latest specs of the contracts pallet. Dropping I will have a look to see what the exact issues are. Do you have an test endpoint (or otherwise Docker image) where I can test the version of the contract pallet you are using? |
Thanks for a quick response! You can use Aleph Zero testnet: The version of pallet contracts that production chains currently use is substrate polkadot-v0.9.38 https://github.com/paritytech/substrate/tree/polkadot-v0.9.38 -- you can alternatively build and run a substrate node from this branch. |
I ran some tests, my findings:
to So basically I will have to:
This will be quitte some work, I think I can start somewhere this week, but it will probably take at least a week before this is available. |
Thanks for working on this! If I can be of any help -- testing stuff, or review, then let me know. I'm also eagerly awaiting metadata V15 -- will be really useful for libraries like this one. |
I'm working on a PR, for now I have a workaround to read and exec contract methods, until the new release. Add the following type registry override to the init: substrate = SubstrateInterface(
url="wss://ws.test.azero.dev",
type_registry={
"types": {
"ContractExecResult": "ContractExecResultTo267"
}
}
) |
First of all -- huge kudos for developing this library -- it's absolutely great, I have been using it quite a lot.
As for the issue I encountered. It seems to me that the support for WeightsV2 is not there yet for Smart Contracts (
ContractInstance
and related classes). In particular the example https://github.com/polkascan/py-substrate-interface/blob/master/examples/create_and_exec_contract.py does not work on WeightsV2 chains.I have dug into it a little, and it seems that's because in places like
py-substrate-interface/substrateinterface/contracts.py
Line 772 in 1f558e6
py-substrate-interface/substrateinterface/contracts.py
Line 797 in 1f558e6
Changing this unfortunately does not fix the problem, there is something else to fix also -- which I haven't figured out yet.
The question is whether there is a plan to add this support? My two comments here:
The text was updated successfully, but these errors were encountered: