-
Notifications
You must be signed in to change notification settings - Fork 78
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
Custom getters #1096
Comments
If the logic is already in the runtime, then you can declare a function with I don't actually know whether PolkadotJS provides a convenient way to use Calling functions that are declared in the runtime is the "correct" way to do this, rather than custom RPCs. If the runtime bloat of exposing these functions is too large (for example if the runtime never actually uses that function internally), we want to add in the future a different way to provide custom logic where the user of the JSON-RPC layer provides a Wasm file containing just the logic that they need. |
ok |
Not exactly. Instead of calling |
I just realized that |
@tomaka is there any example of
I tried something like this but didn't seem to work, I might be encoding the params incorrectly? const encodedCallData = SCALE-encode({ data: '0xSomeData' });
const res = api.rpc.state.call('method_name', encodedCallData); the error I got is
|
paritytech/substrate#2271
Currently we are using custom RPC to implement custom getters to avoid code duplication between runtime logic and frontend.
It is an essential feature and we simply cannot convert to Substrate Connect without this feature.
No smart contract chain is able to use Substrate connect without this.
The text was updated successfully, but these errors were encountered: