df-elysium-core 0.0.1-beta

Elysium SDK for Rust on df-hyperliquid-core: Nitro JSON-RPC, ArbOS precompiles, gas, HyperEVM bridging, deploys and polling, with exact amounts and signing. Native and wasm.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! New heads, each block once, whatever order the polls answer in.

use super::*;

#[test]
fn each_block_is_new_once_and_a_lagging_answer_is_nothing_new() {
    let mut heads = Heads::new();
    assert_eq!(heads.seen(100), Some(100..=100), "the first head alone");
    assert_eq!(heads.seen(100), None, "it has not moved");
    assert_eq!(heads.seen(103), Some(101..=103));
    assert_eq!(heads.seen(102), None, "a node behind the last one asked");
    assert_eq!(heads.last(), Some(103));
    assert_eq!(Heads::after(5).seen(6), Some(6..=6));
}