-
Notifications
You must be signed in to change notification settings - Fork 14
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
Keep more verbose information about each extrinsic #60
Comments
This definitely sounds useful! I'd lean towards fairly directly exposing the scale-info types I think, so that we don't need to copy a bunch of data out of the registry, and all of the information stored away is accessible! Potentially we could wrap the types returned to make things a touch more ergonomic, but if we rely more directly on scale-info we can keep the API here fairly slim, too? |
One possibility here is to make I think that the context would probably have to be entirely ignored when trying to deserialize from Alternately, #66 exposes the type information associated with a given call, and so with that you'd still have a separate tree of types that can be matched up against the tree of |
"Zipping" together the parsed value with the type information seems like it would be mildly non-trivial, especially since |
As an aside, what is the value of deserializing a |
I think it would be useful to experiment with the type info exposed in #66 and see whether it proves to be a pain or not to decode. If I have time, I'll try and construct a non-trivial extrinsic and see how it pans out; it might prove to be useful example code in any case!
Yup, definitely! That was precisely my thought (or allowing any
My thinking here is that There's something I like about keeping the type and value information distinct and disconnected, so long as given both, one is able to attempt proper encoding. But I can see the advantages of having type information alongside it, too! Definitely food for thought :) |
If the "zipping" function were part of desub then it would sort of be six of one, half-dozen of the other. The nice thing about having an "annotated Value" type is that now your zipping function doesn't have to be higher-order.
Now I have to think about how to reduce this callback output. I could provide a reduce function, or assume it comes out as a vector. But the most obvious output of such a function is that it is also a tree of the same shape as the input:
At this point you might as well just write |
I think I can get behind a
|
Good thoughts! You won't need to worry about |
If all you're carrying is |
Yeah, I could deserialize whatever is in the context, but in most cases (like trying to deserialize a Value to a primitive/vec/enum) it would get in the way; the visitor impls for those types would reject an attempt to provide a struct with, say, a "context" and "value" field, for instance. The other wrinkle is that the type So, I suspect it would be cleaner to keep the deserializing much as it is and just ignore the context completely. |
I guess I was thinking of just serializing an integer (TypeId) but I'm not sure that's really useful. If this ends up being a |
Which reminds me... what prevents |
Only time :) Ultimately I'd like a single crate to handle decoding and encoding for sure! |
A way to show the tree of calls along with argument names, type names, and docs for each argument. The calls can be nested (if you use batch or proxy) so that the full tree might be rather large. But the goal is to basically give someone a lot of confidence that the thing they plan to sign is in fact what they intended to do.
Originally posted by @Noch3 in #58 (comment)
@jsdw would be good to get your input
The text was updated successfully, but these errors were encountered: