decdn-client 0.0.2

The deCDN client SDK: fetch content-addressed blobs from deCDN nodes, pay per megabyte from a USDC payment pool, and verify every byte as it arrives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::{DEFAULT_READ_AHEAD_BYTES, PullConfig};

#[test]
fn default_read_ahead_is_the_documented_constant() {
    assert_eq!(
        PullConfig::default().read_ahead_bytes,
        DEFAULT_READ_AHEAD_BYTES
    );
    assert_eq!(DEFAULT_READ_AHEAD_BYTES, 16 * 1024 * 1024);
}

#[test]
fn construction_is_a_pure_const() {
    // A `const` value proves construction runs at compile time — no network
    // or chain access can hide in a `const fn`.
    const CFG: PullConfig = PullConfig::new();
    assert_eq!(CFG.read_ahead_bytes, DEFAULT_READ_AHEAD_BYTES);
}