soda_sol 0.1.1

Generates Solana Projects from an IDL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use soda_sol::structs::IDL;
use walkdir::WalkDir;

pub fn load_idl(idl_path: &str) -> Result<IDL, Box<dyn std::error::Error>> {
    let idl = serde_json::from_str::<IDL>(&std::fs::read_to_string(idl_path)?)?;
    Ok(idl)
}

#[test]
    fn load_idl_from_fs() {
        for idl_path in WalkDir::new("./tests/idls").into_iter().filter_map(|e| e.ok()).filter(|e| e.path().extension().unwrap_or_default() == "json") {
            println!("Loading IDL: {}", idl_path.path().to_str().unwrap());
            assert!(load_idl(idl_path.path().to_str().unwrap()).is_ok())
        }
    }