Skip to content

Commit

Permalink
vm: fix checks for the blocktime window in consensus ordering
Browse files Browse the repository at this point in the history
Co-authored-by: Stefano Pellegrini <33753050+St333p@users.noreply.github.com>
  • Loading branch information
dr-orlovsky and St333p authored Oct 15, 2024
1 parent 4d4078a commit 5ff9821
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ impl Ord for WitnessPos {
match (self.layer1, other.layer1) {
(a, b) if a == b => self.height.cmp(&other.height),

Check warning on line 376 in src/vm/contract.rs

View check run for this annotation

Codecov / codecov/patch

src/vm/contract.rs#L375-L376

Added lines #L375 - L376 were not covered by tests
(Layer1::Bitcoin, Layer1::Liquid)
if (self.timestamp - other.timestamp).abs() >= BLOCK_TIME =>
if (self.timestamp - other.timestamp).abs() < BLOCK_TIME =>
{
Ordering::Greater

Check warning on line 380 in src/vm/contract.rs

View check run for this annotation

Codecov / codecov/patch

src/vm/contract.rs#L378-L380

Added lines #L378 - L380 were not covered by tests
}
(Layer1::Liquid, Layer1::Bitcoin)
if (other.timestamp - self.timestamp).abs() >= BLOCK_TIME =>
if (other.timestamp - self.timestamp).abs() < BLOCK_TIME =>
{
Ordering::Less

Check warning on line 385 in src/vm/contract.rs

View check run for this annotation

Codecov / codecov/patch

src/vm/contract.rs#L383-L385

Added lines #L383 - L385 were not covered by tests
}
Expand Down

0 comments on commit 5ff9821

Please sign in to comment.