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

Function encode_asm_from_json_string

assembler/src/encoder.rs:11–16  ·  view source on GitHub ↗
(json: String)

Source from the content-addressed store, hash-verified

9use std::str::FromStr;
10
11pub fn encode_asm_from_json_file(path: String) -> Result<BinaryProgram, String> {
12 let json_str = std::fs::read_to_string(path).unwrap();
13 let bundle: AsmBundle = serde_json::from_str(json_str.as_str()).unwrap();
14 let relocated = asm_relocate(bundle).unwrap();
15 let program = encode_to_binary(relocated).unwrap();
16 Ok(program)
17}
18
19pub(crate) fn encode_to_binary(bundle: RelocatedAsmBundle) -> Result<BinaryProgram, String> {

Callers 1

runMethod · 0.85

Calls 2

asm_relocateFunction · 0.85
encode_to_binaryFunction · 0.85

Tested by

no test coverage detected