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

Adds BlockNumberProvider in multisig, proxy and nft pallets #5723

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
24 changes: 5 additions & 19 deletions substrate/frame/multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,9 @@ pub mod weights;

extern crate alloc;
use alloc::{boxed::Box, vec, vec::Vec};
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
dispatch::{
DispatchErrorWithPostInfo, DispatchResult, DispatchResultWithPostInfo, GetDispatchInfo,
PostDispatchInfo,
},
ensure,
traits::{Currency, Get, ReservableCurrency},
weights::Weight,
BoundedVec,
};
use frame_system::{self as system, pallet_prelude::BlockNumberFor, RawOrigin};
use scale_info::TypeInfo;
use sp_io::hashing::blake2_256;
use sp_runtime::{
traits::{BlockNumberProvider, Dispatchable, TrailingZeroInput, Zero},
DispatchError, RuntimeDebug,
use frame::{
prelude::*,
traits::{BlockNumberProvider, Currency, ReservableCurrency},
gupnik marked this conversation as resolved.
Show resolved Hide resolved
};
use frame_system::RawOrigin;
pub use weights::WeightInfo;
Expand Down Expand Up @@ -166,7 +152,7 @@ pub mod pallet {
type MaxSignatories: Get<u32>;

/// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;
type WeightInfo: weights::WeightInfo;

/// Provider for the block number. Normally this is the `frame_system` pallet.
gupnik marked this conversation as resolved.
Show resolved Hide resolved
type BlockNumberProvider: BlockNumberProvider<BlockNumber = BlockNumberFor<Self>>;
Expand Down Expand Up @@ -644,7 +630,7 @@ impl<T: Config> Pallet<T> {
pub fn timepoint() -> Timepoint<BlockNumberFor<T>> {
Timepoint {
height: T::BlockNumberProvider::current_block_number(),
index: <system::Pallet<T>>::extrinsic_index().unwrap_or_default(),
index: <frame_system::Pallet<T>>::extrinsic_index().unwrap_or_default(),
}
}

Expand Down
12 changes: 2 additions & 10 deletions substrate/frame/proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,9 @@ extern crate alloc;
use alloc::{boxed::Box, vec};
use frame::{
prelude::*,
traits::{Currency, ReservableCurrency},
traits::{BlockNumberProvider, Currency, ReservableCurrency},
};
pub use pallet::*;
use scale_info::TypeInfo;
use sp_io::hashing::blake2_256;
use sp_runtime::{
traits::{
BlockNumberProvider, Dispatchable, Hash, Saturating, StaticLookup, TrailingZeroInput, Zero,
},
DispatchError, DispatchResult, RuntimeDebug,
};
pub use weights::WeightInfo;

type CallHashOf<T> = <<T as Config>::CallHasher as Hash>::Output;
Expand Down Expand Up @@ -638,7 +630,7 @@ impl<T: Config> Pallet<T> {
let (height, ext_index) = maybe_when.unwrap_or_else(|| {
(
T::BlockNumberProvider::current_block_number(),
system::Pallet::<T>::extrinsic_index().unwrap_or_default(),
frame_system::Pallet::<T>::extrinsic_index().unwrap_or_default(),
)
});
let entropy = (b"modlpy/proxy____", who, height, ext_index, proxy_type, index)
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.