Skip to content
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

update {next,prev}_consensus_state implementations #164

Open
rnbguy opened this issue Feb 26, 2024 · 0 comments
Open

update {next,prev}_consensus_state implementations #164

rnbguy opened this issue Feb 26, 2024 · 0 comments

Comments

@rnbguy
Copy link
Member

rnbguy commented Feb 26, 2024

Bug in next_consensus_state

The following comparison should be reversed.

if height > &IbcHeight::new(path.revision_number, path.revision_height).unwrap() {
return Some(path);
}

Refactor prev_consensus_state

We can simplify the prev_consensus_state as next_consensus_state if we reverse the iterator here.

let pos = keys.iter().position(|path| {

ref impl in ibc-rs testkit.


Apart from that, next_consensus_state and prev_consensus_state - both cases, we are trying to find a partition point. Considering the keys are sorted, we may want to use partition_point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant