You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being arbitrary, some of the types and values in the custom hashmap may not line up (and so codegen should be lenient and just ignore any errors), and the string names are also arbitrary and need not be valid idents or anything.
That said, one could expose codegen for the cases where things appear to line up and the names are ident-ish. It'd be cool to be able to do let query = runtime::custom().foo(); api.custom().at(&query) to access things in custom, decoded to some concrete type (if possible). If the names aren't ident-ish and the values don't point at valid type IDs or whatever then we can just skip them.
If we did add static codegen, we'd also need to have validation logic like we do for constatns etc to check that the codegen we have is still applicable to the node we're talking to.
Given that custom metadata is much more likely to vary a bunch inbetween nodes, I think for now I'd hold off on doing this and wait to see whether there's a need.
Until then, people can still manually decode the bytes into whatever type via a decode_as_type impl
The text was updated successfully, but these errors were encountered:
See #1106 (comment) for context.
Being arbitrary, some of the types and values in the
custom
hashmap may not line up (and so codegen should be lenient and just ignore any errors), and the string names are also arbitrary and need not be valid idents or anything.That said, one could expose codegen for the cases where things appear to line up and the names are ident-ish. It'd be cool to be able to do
let query = runtime::custom().foo(); api.custom().at(&query)
to access things in custom, decoded to some concrete type (if possible). If the names aren't ident-ish and the values don't point at valid type IDs or whatever then we can just skip them.If we did add static codegen, we'd also need to have validation logic like we do for constatns etc to check that the codegen we have is still applicable to the node we're talking to.
Given that custom metadata is much more likely to vary a bunch inbetween nodes, I think for now I'd hold off on doing this and wait to see whether there's a need.
Until then, people can still manually decode the bytes into whatever type via a
decode_as_type
implThe text was updated successfully, but these errors were encountered: