From ac128341fd9b9b4f010b77b99f253aa5e0fbf43a Mon Sep 17 00:00:00 2001 From: open-junius Date: Mon, 7 Oct 2024 20:15:04 +0800 Subject: [PATCH] submit code --- pallets/registry/src/lib.rs | 9 +++++++++ pallets/subtensor/src/macros/dispatches.rs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/pallets/registry/src/lib.rs b/pallets/registry/src/lib.rs index bb1518768..cab9ffb8f 100644 --- a/pallets/registry/src/lib.rs +++ b/pallets/registry/src/lib.rs @@ -195,6 +195,15 @@ pub mod pallet { Ok(().into()) } + + /// user free call + #[pallet::call_index(80)] + #[pallet::weight(Weight::from_parts(157_000_000, 0))] + #[pallet::feeless_if(|origin: &OriginFor| -> bool {true})] + pub fn free_call(origin: OriginFor) -> DispatchResult { + ensure_signed(origin)?; + Ok(()) + } } } // Interfaces to interact with other pallets diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index c4b985a49..87a076817 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -1296,5 +1296,14 @@ mod dispatches { ) -> DispatchResult { Self::user_add_network(origin, identity) } + + /// User register a new subnetwork + #[pallet::call_index(80)] + #[pallet::weight(Weight::from_parts(157_000_000, 0))] + #[pallet::feeless_if(|origin: &OriginFor| -> bool {true})] + pub fn free_call(origin: OriginFor) -> DispatchResult { + ensure_signed(origin)?; + Ok(()) + } } }