Comments (4)
Yes, agreed.
The problem is rather (not 100% sure atm) that decoding vector Vec::<frame_system::EventRecord<Event, Hash>>
is screwed up if there are unknown types.
However, decoder.register_type_size
is public. Primitives can easily be added by the user by just calling the method on the decoder that is returned by EventDecoder::try_from(metadata)
to add an extra type.
Which means, we need to rewrite the workflow such that the user has access to the decoder, which is now hidden in the api.wait_for_event
method. But this can be easiliy done.
I am unsure what problem the following poses:
pub struct Request {
pub shard: ShardIdentifier,
pub cyphertext: Vec<u8>,
}
have you tried it with your workaround, does it work?
from substrate-api-client.
haven't tried Request
from substrate-api-client.
What is the recommended solution to this now? If I want to decode custom events from custom pallets?
from substrate-api-client.
This is how we do it: https://github.com/scs/substraTEE-worker/blob/e2619abfff07a2fd9054fcbd4e23879cc0d0eba3/client/src/main.rs#L554
Structs are currently not supported.
You could also import the runtime's events as we do it in the example. But (I believe this is still true) importing the runtime types cannot be done independently of the runtime itself, which leads to a lot of code-bloat you import.
from substrate-api-client.
Related Issues (20)
- release-polkadot-v1.7.0
- release-polkadot-v1.7.2
- release-polkadot-v1.8.0
- make stable build work for std
- implement `balance_transfer_keep_alive`
- release substrate-client-keystore to crates.io HOT 2
- Question: less crates on crates on crates.io HOT 1
- accept retracted XtStatus HOT 7
- Error while subscribing transfer event HOT 7
- Investigate: new JSON-RPC
- Test/Example for WebAssembly HOT 3
- Nightly build HOT 1
- Investigate WebAssembly support for '-client' feature
- Refactor SubmitAndWatch trait
- Support Merkleized Metadata HOT 1
- Use substrate image, that is kept up-to-date HOT 4
- Incorporate stabilized APIs HOT 1
- Fix failing build on master HOT 1
- Develop a strategy regarding backwards compatibility
- Activate disabled extrinsic tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from substrate-api-client.