-
Notifications
You must be signed in to change notification settings - Fork 323
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
Cleanup mock context for ICS2 #305
Conversation
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.
👍
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 great, left a few comments.
Codecov Report
@@ Coverage Diff @@
## master #305 +/- ##
=========================================
+ Coverage 13.6% 37.7% +24.1%
=========================================
Files 69 124 +55
Lines 3752 8013 +4261
Branches 1374 2778 +1404
=========================================
+ Hits 513 3027 +2514
- Misses 2618 4751 +2133
+ Partials 621 235 -386
Continue to review full report at Codecov.
|
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, a couple comments on dropping the ics2_...
Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
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.
Great!!!
pub fn with_client_parametrized( | ||
self, | ||
client_id: &ClientId, | ||
client_state_height: Height, | ||
client_type: Option<ClientType>, | ||
consensus_state_height: Option<Height>, |
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.
Still not sure about this, seems that the client_state_height
is a bit redundant, not clear what it means if the two heights are different. Maybe just pass an AnyHeader
. But let's leave this for the next step where we support tendermint client and consensus states in the mock context and things will become more clear.
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.
Will merge this after #309. Thanks Anca!
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
let ctx = MockContext::default().with_client_parametrized( | ||
&client_id, | ||
height, | ||
Some(ClientType::Mock), | ||
Some(height.increment()), | ||
); | ||
let height = Height::new(0, 30); |
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.
Note that this is does not result in the same context as before (where two consensus states existed). Another problem is that the context now has a client state with latest height smaller than the highest height of the consensus states, only one here but still an invariant that we don't currently have/check is broken. Maybe add this in a different PR. Until then just remove the increment()
to pass the same height for client and consensus states.
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.
// All the connections in the store. | ||
connections: HashMap<ConnectionId, ConnectionEnd>, | ||
|
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.
can we move these back down again? :)
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.
Closes: #296
For contributor use:
docs/
) and code commentsFiles changed
in the Github PR explorer