ic-query 0.1.2

Internet Computer query CLI for NNS, SNS, and related public network metadata
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::{
    path::PathBuf,
    time::{SystemTime, UNIX_EPOCH},
};

pub fn temp_dir(prefix: &str) -> PathBuf {
    let unique = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .expect("system time after epoch")
        .as_nanos();
    std::env::temp_dir().join(format!("{prefix}-{}-{unique}", std::process::id()))
}

pub fn assert_snapshot(name: &str, actual: &str, expected: &str) {
    assert_eq!(actual, expected, "{name} snapshot changed");
}