mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 21:27:57 +00:00
pallet-sudo: add CheckOnlySudoAccount signed extension (#12496)
* pallet-sudo: add `CheckSudoKey` signed extension Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Rename CheckSudoKey => CheckOnlySudo Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Rename extension name and Add some docs * Apply review suggestions * Update frame/sudo/src/extension.rs Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com> * Update frame/sudo/src/extension.rs Signed-off-by: koushiro <koushiro.cqx@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
//! use frame_system::pallet_prelude::*;
|
||||
//!
|
||||
//! #[pallet::pallet]
|
||||
//! pub struct Pallet<T>(_);
|
||||
//! pub struct Pallet<T>(PhantomData<T>);
|
||||
//!
|
||||
//! #[pallet::config]
|
||||
//! pub trait Config: frame_system::Config {}
|
||||
@@ -79,6 +79,13 @@
|
||||
//! # fn main() {}
|
||||
//! ```
|
||||
//!
|
||||
//! ### Signed Extension
|
||||
//!
|
||||
//! The Sudo pallet defines the following extension:
|
||||
//!
|
||||
//! - [`CheckOnlySudoAccount`]: Ensures that the signed transactions are only valid if they are
|
||||
//! signed by sudo account.
|
||||
//!
|
||||
//! ## Genesis Config
|
||||
//!
|
||||
//! The Sudo pallet depends on the [`GenesisConfig`].
|
||||
@@ -97,11 +104,13 @@ use sp_std::prelude::*;
|
||||
|
||||
use frame_support::{dispatch::GetDispatchInfo, traits::UnfilteredDispatchable};
|
||||
|
||||
mod extension;
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
pub use extension::CheckOnlySudoAccount;
|
||||
pub use pallet::*;
|
||||
|
||||
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
|
||||
|
||||
Reference in New Issue
Block a user