Skip to content

Commit

Permalink
chore: fix no-std build
Browse files Browse the repository at this point in the history
  • Loading branch information
Fumuran committed Apr 22, 2024
1 parent d6a0d9b commit bcd898c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ args = ["build", "--no-default-features", "--target", "wasm32-unknown-unknown",
description = "Run all available transaction benchmarks"
workspace = false
command = "cargo"
args = ["run", "--bin", "bench-tx"]
args = ["run", "--bin", "bench-tx", "--features", "std"]

# --- utilities -----------------------------------------------------------------------------------
[tasks.watch]
Expand Down
6 changes: 5 additions & 1 deletion bench-tx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ exclude.workspace = true
[[bin]]
name = "bench-tx"
path = "src/main.rs"
required-features = ["std"]

[features]
std = ["mock/std"]

[dependencies]
miden-lib = { package = "miden-lib", path = "../miden-lib", version = "0.3" }
miden-objects = { package = "miden-objects", path = "../objects", version = "0.3" }
miden-tx = { package = "miden-tx", path = "../miden-tx", version = "0.3" }
mock = { package = "miden-mock", path = "../mock", features = ["std"] }
mock = { package = "miden-mock", path = "../mock", features = ["std"], default-features = false, optional = true }
serde_json = { package = "serde_json", version = "1.0" }
vm-processor = { workspace = true }
2 changes: 1 addition & 1 deletion bench-tx/src/bench-tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"0x8a55c3531cdd5725aa805475093ed3006c6773b71a008e8ca840da8364a67cd6": 713
},
{
"0xae832786b774651bb0e5b71615fcf9f01427c054a8919cda6d2fd4a0c8948167": 390
"0x47b2fbff8a3f09e40343238e7b15c8918d7c63e570fd1b3c904ada458c4d74bd": 390
}
],
"notes_processing": 1149,
Expand Down
11 changes: 7 additions & 4 deletions bench-tx/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,13 @@ pub fn get_account_with_default_account_code(
let account_assembler = TransactionKernel::assembler();

let account_code = AccountCode::new(account_code_ast.clone(), &account_assembler).unwrap();
let account_storage = AccountStorage::new(vec![SlotItem {
index: 0,
slot: StorageSlot::new_value(public_key),
}])
let account_storage = AccountStorage::new(
vec![SlotItem {
index: 0,
slot: StorageSlot::new_value(public_key),
}],
vec![],
)
.unwrap();

let account_vault = match assets {
Expand Down

0 comments on commit bcd898c

Please sign in to comment.