diff --git a/pallets/registry/src/benchmarking.rs b/pallets/registry/src/benchmarking.rs index 68074078b..82b9fe9fb 100644 --- a/pallets/registry/src/benchmarking.rs +++ b/pallets/registry/src/benchmarking.rs @@ -163,7 +163,7 @@ benchmarks! { assert!(Registering::::contains_key(sig_req_account)); } - on_chain_registration { + register_on_chain { let p in 1 .. T::MaxProgramHashes::get(); let program_modification_account: T::AccountId = whitelisted_caller(); diff --git a/pallets/registry/src/lib.rs b/pallets/registry/src/lib.rs index 0d049eb08..804791797 100644 --- a/pallets/registry/src/lib.rs +++ b/pallets/registry/src/lib.rs @@ -736,10 +736,9 @@ pub mod pallet { /// registration request will produce a different verifying key. #[pallet::call_index(7)] #[pallet::weight({ - // TODO (Nando): Use actual benchmark - ::WeightInfo::on_chain_registration(::MaxProgramHashes::get()) + ::WeightInfo::register_on_chain(::MaxProgramHashes::get()) })] - pub fn on_chain_registration( + pub fn register_on_chain( origin: OriginFor, program_modification_account: T::AccountId, programs_data: BoundedVec, T::MaxProgramHashes>, diff --git a/pallets/registry/src/tests.rs b/pallets/registry/src/tests.rs index 7da4a72c5..ff893f48f 100644 --- a/pallets/registry/src/tests.rs +++ b/pallets/registry/src/tests.rs @@ -95,7 +95,7 @@ fn it_registers_a_user_on_chain() { }); // Test: Run through registration - assert_ok!(Registry::on_chain_registration( + assert_ok!(Registry::register_on_chain( RuntimeOrigin::signed(alice), bob, programs_info.clone(), @@ -137,13 +137,13 @@ fn it_registers_different_users_with_the_same_sig_req_account() { // Test: Run through registration twice using the same signature request account. We should // get different verifying keys. - assert_ok!(Registry::on_chain_registration( + assert_ok!(Registry::register_on_chain( RuntimeOrigin::signed(alice), bob, programs_info.clone(), )); - assert_ok!(Registry::on_chain_registration( + assert_ok!(Registry::register_on_chain( RuntimeOrigin::signed(alice), bob, programs_info.clone(), diff --git a/pallets/registry/src/weights.rs b/pallets/registry/src/weights.rs index 541bb392a..c05652709 100644 --- a/pallets/registry/src/weights.rs +++ b/pallets/registry/src/weights.rs @@ -52,7 +52,7 @@ use core::marker::PhantomData; /// Weight functions needed for pallet_registry. pub trait WeightInfo { fn register(p: u32) -> Weight; - fn on_chain_registration(_p: u32) -> Weight; + fn register_on_chain(_p: u32) -> Weight; fn jump_start_network() -> Weight; fn prune_registration(p: u32) -> Weight; fn confirm_jump_start_done(c: u32, ) -> Weight; @@ -147,7 +147,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Registry::ModifiableKeys` (r:1 w:1) /// Proof: `Registry::ModifiableKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `p` is `[1, 5]`. - fn on_chain_registration(_p: u32, ) -> Weight { + fn register_on_chain(_p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `563` // Estimated: `4028` @@ -345,7 +345,7 @@ impl WeightInfo for () { /// Storage: `Registry::ModifiableKeys` (r:1 w:1) /// Proof: `Registry::ModifiableKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `p` is `[1, 5]`. - fn on_chain_registration(_p: u32, ) -> Weight { + fn register_on_chain(_p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `563` // Estimated: `4028` diff --git a/runtime/src/weights/pallet_registry.rs b/runtime/src/weights/pallet_registry.rs index b04f7497e..d8d11c546 100644 --- a/runtime/src/weights/pallet_registry.rs +++ b/runtime/src/weights/pallet_registry.rs @@ -127,7 +127,7 @@ impl pallet_registry::WeightInfo for WeightInfo { /// Storage: `Registry::ModifiableKeys` (r:1 w:1) /// Proof: `Registry::ModifiableKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `p` is `[1, 5]`. - fn on_chain_registration(_p: u32, ) -> Weight { + fn register_on_chain(_p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `563` // Estimated: `4028`