-
Notifications
You must be signed in to change notification settings - Fork 354
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
Convenient way to invoke runtime API #4930
Comments
Sounds sane, but I have no idea what you want here and what it would look like. PRs are welcome. (This is really the best approach, since it needs to be tested and since it is something I won't use myself, would need guidance - worst is "guess work") |
Looked at this a bit - as always, we seem to be opening a small can of worms here which is not that easy to untangle since we don't have metadata info for the With that outstanding it makes sense to do this in tranches, the first being The first gets the infrastructure in-place, the second would basically require a whole lot of untangling when it hits metadata, so basically would requiring doing the same work twice and differently. In neither of these will be actually add "base definitions" (never say never... this is "as of now") to the |
To give some additional info: Right now the versioning of the runtime calls is done through the If a runtime developer modifies the signature of a function (or logic, in a significant way), they're supposed to update the version of the API. The risk of not doing so is that your parameters get misinterpreted, or that you misinterpret the return value. If you're unlucky, it will seem that everything is working, but you'll actually get garbage values. Of course, this API version check is necessary only because the function signatures are not found in the metadata. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Context: paritytech/substrate-connect#1096
We would like to replace custom RPC with
state_call
but we need a better API to invoke runtime APIs.We should be able to supply a definition (similar to RPC defs) and polkadot.js should be able to use it to generate methods like
api.call.evm.execute(contract_addr, input)
and return the decoded response.In future, if we can make metadata to include runtime API defs, then we can automatically generate those methods from metadata.
The text was updated successfully, but these errors were encountered: