pub fn create_reserves_record(block: U64, log: (Vec<PairA>, U256)) {
println!(" ~ Attempting to create json.");
let j = serde_json::to_string(&log).expect("prettyify error");
let new_dir = format!("./src/logs/{}.json", block);
match std::fs::create_dir(&new_dir) {
Ok(_) => {
std::fs::write(new_dir, j).expect("unable to write to json");
println!(" ~ [PASS] Created JSON");
},
Err(_) => println!(" ~ [FAILED] Created JSON"),
}
}
I think im just creating the same directory instead of a json .-.
