Skip to content

Commit

Permalink
fix: include account module in MidenTxKernelLibrary;
Browse files Browse the repository at this point in the history
Build MASM for the basic wallet Rust SDK test.
  • Loading branch information
greenhat committed Oct 14, 2024
1 parent 645aec4 commit 2802aa7
Show file tree
Hide file tree
Showing 6 changed files with 2,976 additions and 12 deletions.
10 changes: 5 additions & 5 deletions sdk/base-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ fn main() {
let source_manager = Arc::new(miden_assembly::DefaultSourceManager::default());
let namespace = "miden".parse::<LibraryNamespace>().expect("invalid base namespace");

let tx_asm_dir = Path::new(manifest_dir).join("masm").join("tx");
let asm_dir = Path::new(manifest_dir).join("masm").join("miden");
let asm = Assembler::new(source_manager);
let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, asm).unwrap();
let tx_masl_path = build_dir
let lib = CompiledLibrary::from_dir(asm_dir, namespace, asm).unwrap();
let masl_path = build_dir
.join("assets")
.join("tx")
.join("miden")
.with_extension(CompiledLibrary::LIBRARY_EXTENSION);
txlib.write_to_file(tx_masl_path).into_diagnostic().unwrap();
lib.write_to_file(masl_path).into_diagnostic().unwrap();
}

#[cfg(not(feature = "masl-lib"))]
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions sdk/base-sys/src/masl/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ impl From<MidenTxKernelLibrary> for CompiledLibrary {

impl Default for MidenTxKernelLibrary {
fn default() -> Self {
let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/tx.masl"));
let contents = CompiledLibrary::read_from_bytes(bytes).expect("failed to read std masl!");
let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/miden.masl"));
let contents =
CompiledLibrary::read_from_bytes(bytes).expect("failed to read Miden tx kernel masl!");
Self(contents)
}
}
Loading

0 comments on commit 2802aa7

Please sign in to comment.