Skip to content

Commit

Permalink
Rename extrinsic to register_on_chain
Browse files Browse the repository at this point in the history
  • Loading branch information
HCastano committed Aug 2, 2024
1 parent 3923688 commit 6f02367
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pallets/registry/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ benchmarks! {
assert!(Registering::<T>::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();
Expand Down
5 changes: 2 additions & 3 deletions pallets/registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
<T as Config>::WeightInfo::on_chain_registration(<T as Config>::MaxProgramHashes::get())
<T as Config>::WeightInfo::register_on_chain(<T as Config>::MaxProgramHashes::get())
})]
pub fn on_chain_registration(
pub fn register_on_chain(
origin: OriginFor<T>,
program_modification_account: T::AccountId,
programs_data: BoundedVec<ProgramInstance<T>, T::MaxProgramHashes>,
Expand Down
6 changes: 3 additions & 3 deletions pallets/registry/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions pallets/registry/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -147,7 +147,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// 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`
Expand Down Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/weights/pallet_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<T: frame_system::Config> pallet_registry::WeightInfo for WeightInfo<T> {
/// 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`
Expand Down

0 comments on commit 6f02367

Please sign in to comment.