Giter Club home page Giter Club logo

Comments (4)

clangenb avatar clangenb commented on September 15, 2024

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.

brenzi avatar brenzi commented on September 15, 2024

haven't tried Request

from substrate-api-client.

kylezs avatar kylezs commented on September 15, 2024

What is the recommended solution to this now? If I want to decode custom events from custom pallets?

from substrate-api-client.

clangenb avatar clangenb commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.