mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Rename pallet trait Trait to Config (#7599)
* rename Trait to Config * add test asserting using Trait is still valid. * fix ui tests
This commit is contained in:
committed by
GitHub
parent
dd3c84c362
commit
1cbfc9257f
@@ -18,7 +18,7 @@
|
||||
//! # Multisig Module
|
||||
//! A module for doing multisig dispatch.
|
||||
//!
|
||||
//! - [`multisig::Trait`](./trait.Trait.html)
|
||||
//! - [`multisig::Config`](./trait.Config.html)
|
||||
//! - [`Call`](./enum.Call.html)
|
||||
//!
|
||||
//! ## Overview
|
||||
@@ -41,7 +41,7 @@
|
||||
//! * `cancel_as_multi` - Cancel a call from a composite origin.
|
||||
//!
|
||||
//! [`Call`]: ./enum.Call.html
|
||||
//! [`Trait`]: ./trait.Trait.html
|
||||
//! [`Config`]: ./trait.Config.html
|
||||
|
||||
// Ensure we're `no_std` when compiling for Wasm.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
@@ -62,14 +62,14 @@ use frame_system::{self as system, ensure_signed, RawOrigin};
|
||||
use sp_runtime::{DispatchError, DispatchResult, traits::{Dispatchable, Zero}};
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
|
||||
type BalanceOf<T> = <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
|
||||
/// Just a bunch of bytes, but they should decode to a valid `Call`.
|
||||
pub type OpaqueCall = Vec<u8>;
|
||||
|
||||
/// Configuration trait.
|
||||
pub trait Trait: frame_system::Trait {
|
||||
pub trait Config: frame_system::Config {
|
||||
/// The overarching event type.
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
|
||||
|
||||
/// The overarching call type.
|
||||
type Call: Parameter + Dispatchable<Origin=Self::Origin, PostInfo=PostDispatchInfo>
|
||||
@@ -123,7 +123,7 @@ pub struct Multisig<BlockNumber, Balance, AccountId> {
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
trait Store for Module<T: Trait> as Multisig {
|
||||
trait Store for Module<T: Config> as Multisig {
|
||||
/// The set of open multisig operations.
|
||||
pub Multisigs: double_map
|
||||
hasher(twox_64_concat) T::AccountId, hasher(blake2_128_concat) [u8; 32]
|
||||
@@ -134,7 +134,7 @@ decl_storage! {
|
||||
}
|
||||
|
||||
decl_error! {
|
||||
pub enum Error for Module<T: Trait> {
|
||||
pub enum Error for Module<T: Config> {
|
||||
/// Threshold must be 2 or greater.
|
||||
MinimumThreshold,
|
||||
/// Call is already approved by this signatory.
|
||||
@@ -169,8 +169,8 @@ decl_error! {
|
||||
decl_event! {
|
||||
/// Events type.
|
||||
pub enum Event<T> where
|
||||
AccountId = <T as system::Trait>::AccountId,
|
||||
BlockNumber = <T as system::Trait>::BlockNumber,
|
||||
AccountId = <T as system::Config>::AccountId,
|
||||
BlockNumber = <T as system::Config>::BlockNumber,
|
||||
CallHash = [u8; 32]
|
||||
{
|
||||
/// A new multisig operation has begun. \[approving, multisig, call_hash\]
|
||||
@@ -191,7 +191,7 @@ enum CallOrHash {
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
pub struct Module<T: Config> for enum Call where origin: T::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
/// Deposit one of this module's events by using the default implementation.
|
||||
@@ -232,7 +232,7 @@ decl_module! {
|
||||
)]
|
||||
fn as_multi_threshold_1(origin,
|
||||
other_signatories: Vec<T::AccountId>,
|
||||
call: Box<<T as Trait>::Call>,
|
||||
call: Box<<T as Config>::Call>,
|
||||
) -> DispatchResultWithPostInfo {
|
||||
let who = ensure_signed(origin)?;
|
||||
let max_sigs = T::MaxSignatories::get() as usize;
|
||||
@@ -443,7 +443,7 @@ decl_module! {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Trait> Module<T> {
|
||||
impl<T: Config> Module<T> {
|
||||
/// Derive a multi-account ID from the sorted list of accounts and the threshold that are
|
||||
/// required.
|
||||
///
|
||||
@@ -615,7 +615,7 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
|
||||
/// Attempt to decode and return the call, provided by the user or from storage.
|
||||
fn get_call(hash: &[u8; 32], maybe_known: Option<&[u8]>) -> Option<(<T as Trait>::Call, usize)> {
|
||||
fn get_call(hash: &[u8; 32], maybe_known: Option<&[u8]>) -> Option<(<T as Config>::Call, usize)> {
|
||||
maybe_known.map_or_else(|| {
|
||||
Calls::<T>::get(hash).and_then(|(data, ..)| {
|
||||
Decode::decode(&mut &data[..]).ok().map(|d| (d, data.len()))
|
||||
|
||||
Reference in New Issue
Block a user