Trait sp_runtime::traits::BlockNumberProvider
source · pub trait BlockNumberProvider {
type BlockNumber: Codec + Clone + Ord + Eq + AtLeast32BitUnsigned;
// Required method
fn current_block_number() -> Self::BlockNumber;
}
Expand description
Get current block number
Required Associated Types§
sourcetype BlockNumber: Codec + Clone + Ord + Eq + AtLeast32BitUnsigned
type BlockNumber: Codec + Clone + Ord + Eq + AtLeast32BitUnsigned
Type of BlockNumber
to provide.
Required Methods§
sourcefn current_block_number() -> Self::BlockNumber
fn current_block_number() -> Self::BlockNumber
Returns the current block number.
Provides an abstraction over an arbitrary way of providing the current block number.
In case of using crate sp_runtime
with the crate frame-system
,
it is already implemented for
frame_system::Pallet<T: Config>
as:
ⓘ
fn current_block_number() -> Self {
frame_system::Pallet<Config>::block_number()
}
.