-
Notifications
You must be signed in to change notification settings - Fork 254
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
Fix subxt metadata
fallback code to work with default opts
#1127
Conversation
if !matches!( | ||
version, | ||
MetadataVersion::Latest | MetadataVersion::Version(14) | ||
) { | ||
return Err(FetchMetadataError::Other( | ||
"The node can only return version 14 metadata using the legacy API but you've asked for something else" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this message say that it supports "v14" or "latest"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only V14 can be provided from this legacy route, so whether they ask for V14 or "latest that node has" that's what they will get back, so I htink it's all good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I see didn't understand that :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I wonder if it's worth checking that the Latest
version from the node is 14 / or if the API to fetch the version returns MethodNotIMplemented
?
Ideally, in the future we'd have the V15 nodes. The inner_legacy
method could still fetch V14 when the V15 code path fails (with maybe some network error). I think that's fine since it should be considered a fallback :D
My reasoning was that if we are trying this legacy path, then we have already failed to call the "new" methods, and so the node only supports V14 (please do correct me if I'm wrong though :)) Edit: Ah yeah, like you said I guess it's a bit more subtle than that because we don't look at what exactly failed to get us to the fetch_legacy code path, and yeah we should pay more attention to the specific error! I geuss I'm not too bothered either because it's just a fallback thing :) |
* work in progress * add custom types access * nit * custom values client * adjust light client * adjust doc comments * adjust book for custom values in code gen * format and check docs * work in progress * add custom types access * nit * custom values client * adjust light client * codegen and validation * adjust docs * use ignore in docs in book * change iter implementation * use validation hash and other codegen changes * add ui test for custom values codegen * allow 'latest' metadata to be returned from the fallback code (#1127) * nits * fix validation check * fix comments * nits --------- Co-authored-by: James Wilson <james@jsdw.me>
Closes #1125