-
Notifications
You must be signed in to change notification settings - Fork 359
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
modules: Clean up modules' errors #1334
Conversation
One more remark @yito88: your contributions are very valuable and we're very thankful! I think you will receive rights (cc @romac) to open branches in this repository, unless you can already do that. In future PRs, could you consider opening merges from a branch in this repo (as opposed to your own fork)? That would slightly improve reviewing experience since it will make it easier for us to switch to your dev branch and read code on own local copy. Edit: I stand corrected. We'll talk within Informal and there may be org-level restrictions about allowing non-org members to write to our repos. We may need to continue with the same approach as we currently do (i.e., continue opening PRs from the fork). Also, Romain drew my attention to |
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 @yito88! Just one more thing - compilation is currently failing for tests. Here's a fix ->
diff --git a/modules/src/ics04_channel/handler/chan_open_try.rs b/modules/src/ics04_channel/handler/chan_open_try.rs
index dd71eb65..5191e0ef 100644
--- a/modules/src/ics04_channel/handler/chan_open_try.rs
+++ b/modules/src/ics04_channel/handler/chan_open_try.rs
@@ -370,12 +370,16 @@ mod tests {
msg: ChannelMsg::ChannelOpenTry(msg.clone()),
want_pass: false,
match_error: Box::new(|e| match e {
- error::ErrorDetail::Ics02Client(e) => {
+ error::ErrorDetail::Ics03Connection(e) => {
assert_eq!(
e.source,
- ics02_error::ErrorDetail::ClientNotFound(
- ics02_error::ClientNotFoundSubdetail {
- client_id: ClientId::new(ClientType::Mock, 45).unwrap()
+ ics03_error::ErrorDetail::Ics02Client(
+ ics03_error::Ics02ClientSubdetail {
+ source: ics02_error::ErrorDetail::ClientNotFound(
+ ics02_error::ClientNotFoundSubdetail {
+ client_id: ClientId::new(ClientType::Mock, 45).unwrap()
+ }
+ )
}
)
);
Once #1283 is merged, it would be great if you could rebase on/merge with master.
024bc17
to
ceddb00
Compare
Thank you for reviewing and fixing! |
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.
Nice idea to consolidate the errors like this. Great work!
error::ErrorDetail::Ics03Connection(e) => { | ||
assert_eq!( | ||
e.source, | ||
ics03_error::ErrorDetail::Ics02Client( |
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.
This is a bit of a mouthful, but on the other hand, it's good we can decompose the error here and assert on the precise details. This is just a remark, not a suggestion for any change.
* clean up redundant errors * add a log * remove ics02_error from ics04_error * fix a test to check the correct error
Closes: informalsystems/ibc-rs#72
based on #1283
Description
Ics02Error
andIcs03Error
toIcs04Error
MissingNext*Seq
errorFor contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.