MCPcopy Create free account
hub / github.com/Sin7Y/olavm / decode_binary_program_from_file

Function decode_binary_program_from_file

core/src/program/decoder.rs:5–11  ·  view source on GitHub ↗
(path: String)

Source from the content-addressed store, hash-verified

3use std::collections::HashMap;
4
5pub fn decode_binary_program_from_file(path: String) -> Result<Vec<BinaryInstruction>, String> {
6 let program_json = std::fs::read_to_string(path)
7 .map_err(|err| format!("File read to string failed {}", err))?;
8 let program: BinaryProgram = serde_json::from_str(program_json.as_str())
9 .map_err(|err| format!("serde json from string failed {}", err))?;
10 return decode_binary_program_to_instructions(program);
11}
12
13pub fn decode_binary_program_to_instructions(
14 program: BinaryProgram,

Callers

nothing calls this directly

Tested by

no test coverage detected