Skip to content

Commit ae6a4ae

Browse files
committed
fix(bench): seed storage by the components' namespaced slot names
The example benchmarks seed the auth component's `owner_public_key` and the counter contract's `count_map` by slot name, but still used the old `<package>::<interface>::<field>` names. Storage slots are now named `<namespace>::<field>`, so instantiating the auth component failed with "init storage value ... was not provided". Use the namespaced names.
1 parent ed547f6 commit ae6a4ae

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎benches/src/mockchain.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fn build_rpo_auth_transaction(packages: &ScenarioPackages) -> Result<MockTransac
298298
let public_key: Word = secret_key.public_key().to_commitment().into();
299299
let mut auth_storage = InitStorageData::default();
300300
auth_storage.insert_value(
301-
"auth_component_rpo_falcon512::auth_component::owner_public_key",
301+
"miden::auth_component_rpo_falcon512::auth_component::owner_public_key",
302302
public_key,
303303
)?;
304304
let auth_component = AccountComponent::from_package(
@@ -331,7 +331,8 @@ fn build_rpo_auth_transaction(packages: &ScenarioPackages) -> Result<MockTransac
331331
}
332332

333333
fn build_counter_transaction(packages: &ScenarioPackages) -> Result<MockTransaction> {
334-
let counter_slot = StorageSlotName::new("counter_contract::counter_contract::count_map")?;
334+
let counter_slot =
335+
StorageSlotName::new("miden::counter_contract::counter_contract::count_map")?;
335336
let mut counter_storage = InitStorageData::default();
336337
counter_storage.insert_map_entry(counter_slot.clone(), COUNTER_STORAGE_KEY, 1_u64)?;
337338
let counter_component = AccountComponent::from_package(

0 commit comments

Comments
 (0)