-
Notifications
You must be signed in to change notification settings - Fork 124
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
Clean up Api Error and indicate future status clearly #424
Conversation
@@ -21,7 +21,6 @@ use alloc::{borrow::ToOwned, vec::Vec}; | |||
use codec::{Decode, Encode}; | |||
|
|||
pub use decoder::*; | |||
pub use error::*; |
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.
Needed to remove this one because in the api the node-api is also rexported with pub use ..::*; The default error should be the one from api-client, not the node-api.
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.
I see, in general I think we should be more conscious about exports anyhow than just wildcard re-exporting anything.
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.
Yes, I agree. Let me take that into an issue.
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.
#430 :) Thanks for the input
@@ -32,13 +32,13 @@ pub enum Error { | |||
Metadata(MetadataError), | |||
InvalidMetadata(InvalidMetadataError), | |||
NodeApi(ac_node_api::error::Error), | |||
StorageValueDecode(codec::Error), |
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.
Renamed to Codec, as it's already used for general decoding errors, not just StorageValue.
@@ -32,13 +32,13 @@ pub enum Error { | |||
Metadata(MetadataError), | |||
InvalidMetadata(InvalidMetadataError), | |||
NodeApi(ac_node_api::error::Error), | |||
StorageValueDecode(codec::Error), | |||
UnsupportedXtStatus(XtStatus), |
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.
Removed, as it was not used at all.
23b2564
to
35396fa
Compare
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.
LGTM. I like the improved descriptions and the new UnexpectedTxStatus
rename is_supported to is_valid rename is_valid to is_expected some more clean up add unexpected Tx status enum add some comment
35396fa
to
72809e4
Compare
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.
Thanks, looks good to me!
@@ -21,7 +21,6 @@ use alloc::{borrow::ToOwned, vec::Vec}; | |||
use codec::{Decode, Encode}; | |||
|
|||
pub use decoder::*; | |||
pub use error::*; |
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.
I see, in general I think we should be more conscious about exports anyhow than just wildcard re-exporting anything.
FinalityTimeout
from expected. Reasoning: If one waits forFinalized
, but a Timeout is encountered, the loop would go on forever.