Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try feeless attribute #844

Open
wants to merge 2 commits into
base: devnet-ready
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pallets/registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>| -> bool {true})]
pub fn free_call(origin: OriginFor<T>) -> DispatchResult {
ensure_signed(origin)?;
Ok(())
}
}
}
// Interfaces to interact with other pallets
Expand Down
9 changes: 9 additions & 0 deletions pallets/subtensor/src/macros/dispatches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1366,5 +1366,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<T>| -> bool {true})]
pub fn free_call(origin: OriginFor<T>) -> DispatchResult {
ensure_signed(origin)?;
Ok(())
}
}
}
Loading