pub struct Pallet<T, I = ()>(/* private fields */);
Expand description
The Pallet
struct, the main type that implements traits and standalone
functions within the pallet.
Implementations§
Source§impl<T: Config<I>, I: 'static> Pallet<T, I>
impl<T: Config<I>, I: 'static> Pallet<T, I>
Sourcepub fn feed_values(
origin: OriginFor<T>,
values: BoundedVec<(T::OracleKey, T::OracleValue), T::MaxFeedValues>,
) -> DispatchResultWithPostInfo
pub fn feed_values( origin: OriginFor<T>, values: BoundedVec<(T::OracleKey, T::OracleValue), T::MaxFeedValues>, ) -> DispatchResultWithPostInfo
Feed the external value.
Require authorized operator.
Source§impl<T: Config<I>, I: 'static> Pallet<T, I>
impl<T: Config<I>, I: 'static> Pallet<T, I>
Sourcepub fn raw_values<KArg1, KArg2>(
k1: KArg1,
k2: KArg2,
) -> Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>
pub fn raw_values<KArg1, KArg2>( k1: KArg1, k2: KArg2, ) -> Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>
An auto-generated getter for RawValues
.
Source§impl<T: Config<I>, I: 'static> Pallet<T, I>
impl<T: Config<I>, I: 'static> Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> Pallet<T, I>
impl<T: Config<I>, I: 'static> Pallet<T, I>
pub fn read_raw_values( key: &T::OracleKey, ) -> Vec<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>
Sourcepub fn get(
key: &T::OracleKey,
) -> Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>
pub fn get( key: &T::OracleKey, ) -> Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>
Fetch current combined value.
pub fn get_all_values() -> Vec<(T::OracleKey, Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>)>
Trait Implementations§
Source§impl<T: Config<I>, I: 'static> BeforeAllRuntimeMigrations for Pallet<T, I>
impl<T: Config<I>, I: 'static> BeforeAllRuntimeMigrations for Pallet<T, I>
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Something that should happen before runtime migrations are executed.
Source§impl<T: Config<I>, I: 'static> Callable<T> for Pallet<T, I>
impl<T: Config<I>, I: 'static> Callable<T> for Pallet<T, I>
type RuntimeCall = Call<T, I>
Source§impl<T: Config<I>, I: 'static> ChangeMembers<<T as Config>::AccountId> for Pallet<T, I>
impl<T: Config<I>, I: 'static> ChangeMembers<<T as Config>::AccountId> for Pallet<T, I>
Source§fn change_members_sorted(
_incoming: &[T::AccountId],
outgoing: &[T::AccountId],
_new: &[T::AccountId],
)
fn change_members_sorted( _incoming: &[T::AccountId], outgoing: &[T::AccountId], _new: &[T::AccountId], )
A number of members
_incoming
just joined the set and replaced some _outgoing
ones. The
new set is thus given by sorted_new
and must be sorted. Read moreSource§fn change_members(
incoming: &[AccountId],
outgoing: &[AccountId],
new: Vec<AccountId>,
)
fn change_members( incoming: &[AccountId], outgoing: &[AccountId], new: Vec<AccountId>, )
A number of members
incoming
just joined the set and replaced some outgoing
ones. The
new set is given by new
, and need not be sorted. Read moreSource§fn set_members_sorted(new_members: &[AccountId], old_members: &[AccountId])
fn set_members_sorted(new_members: &[AccountId], old_members: &[AccountId])
Set the new members; they must already be sorted. This will compute the diff and use it
to call
change_members_sorted
. Read moreSource§fn compute_members_diff_sorted(
new_members: &[AccountId],
old_members: &[AccountId],
) -> (Vec<AccountId>, Vec<AccountId>)
fn compute_members_diff_sorted( new_members: &[AccountId], old_members: &[AccountId], ) -> (Vec<AccountId>, Vec<AccountId>)
Compute diff between new and old members; they must already be sorted. Read more
Source§impl<T: Config<I>, I: 'static> DataFeeder<<T as Config<I>>::OracleKey, <T as Config<I>>::OracleValue, <T as Config>::AccountId> for Pallet<T, I>
impl<T: Config<I>, I: 'static> DataFeeder<<T as Config<I>>::OracleKey, <T as Config<I>>::OracleValue, <T as Config>::AccountId> for Pallet<T, I>
Source§fn feed_value(
who: Option<T::AccountId>,
key: T::OracleKey,
value: T::OracleValue,
) -> DispatchResult
fn feed_value( who: Option<T::AccountId>, key: T::OracleKey, value: T::OracleValue, ) -> DispatchResult
Provide a new value for a given key from an operator
Source§impl<T: Config<I>, I: 'static> DataProvider<<T as Config<I>>::OracleKey, <T as Config<I>>::OracleValue> for Pallet<T, I>
impl<T: Config<I>, I: 'static> DataProvider<<T as Config<I>>::OracleKey, <T as Config<I>>::OracleValue> for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> DataProviderExtended<<T as Config<I>>::OracleKey, TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>> for Pallet<T, I>
impl<T: Config<I>, I: 'static> DataProviderExtended<<T as Config<I>>::OracleKey, TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>> for Pallet<T, I>
Source§fn get_no_op(
key: &T::OracleKey,
) -> Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>
fn get_no_op( key: &T::OracleKey, ) -> Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>
Get timestamped value by key
Source§fn get_all_values() -> Vec<(T::OracleKey, Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>)>
fn get_all_values() -> Vec<(T::OracleKey, Option<TimestampedValue<<T as Config<I>>::OracleValue, <<T as Config<I>>::Time as Time>::Moment>>)>
Provide a list of tuples of key and timestamped value
Source§impl<T: Config<I>, I: 'static> DispatchViewFunction for Pallet<T, I>
impl<T: Config<I>, I: 'static> DispatchViewFunction for Pallet<T, I>
fn dispatch_view_function<O: Output>( id: &ViewFunctionId, input: &mut &[u8], output: &mut O, ) -> Result<(), ViewFunctionDispatchError>
Source§impl<T: Config<I>, I: 'static> GetStorageVersion for Pallet<T, I>
impl<T: Config<I>, I: 'static> GetStorageVersion for Pallet<T, I>
Source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
Returns the in-code storage version as specified in the
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Returns the storage version of the pallet as last set in the actual on-chain storage.
Source§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
👎Deprecated: This method has been renamed to
in_code_storage_version
and will be removed after March 2024.DEPRECATED: Use
Self::current_storage_version
instead. Read moreSource§impl<T: Config<I>, I: 'static> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn on_initialize(_n: BlockNumberFor<T>) -> Weight
fn on_initialize(_n: BlockNumberFor<T>) -> Weight
on_initialize
to return the weight used in on_finalize
.
Source§fn on_finalize(_n: BlockNumberFor<T>)
fn on_finalize(_n: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
A hook to run logic after inherent application. Read more
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME
Executive
pallet. Read moreSource§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
Source§fn integrity_test()
fn integrity_test()
Check the integrity of this pallet’s configuration. Read more
Source§impl<T: Config<I>, I: 'static> IntegrityTest for Pallet<T, I>
impl<T: Config<I>, I: 'static> IntegrityTest for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read more
Source§impl<T: Config<I>, I: 'static> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
See
Hooks::on_finalize
.Source§impl<T: Config<I>, I: 'static> OnGenesis for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnGenesis for Pallet<T, I>
Source§fn on_genesis()
fn on_genesis()
Something that should happen at genesis.
Source§impl<T: Config<I>, I: 'static> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn on_idle(n: BlockNumberFor<T>, remaining_weight: Weight) -> Weight
fn on_idle(n: BlockNumberFor<T>, remaining_weight: Weight) -> Weight
See
Hooks::on_idle
.Source§impl<T: Config<I>, I: 'static> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
See
Hooks::on_initialize
.Source§impl<T: Config<I>, I: 'static> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn on_poll(n: BlockNumberFor<T>, weight: &mut WeightMeter)
fn on_poll(n: BlockNumberFor<T>, weight: &mut WeightMeter)
Code to execute every now and then at the beginning of the block after inherent application. Read more
Source§impl<T: Config<I>, I: 'static> OnRuntimeUpgrade for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnRuntimeUpgrade for Pallet<T, I>
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§impl<T: Config<I>, I: 'static> PalletInfoAccess for Pallet<T, I>
impl<T: Config<I>, I: 'static> PalletInfoAccess for Pallet<T, I>
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Name of the Rust module containing the pallet.
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Version of the crate containing the pallet.
Source§impl<T: Config<I>, I: 'static> PalletsInfoAccess for Pallet<T, I>
impl<T: Config<I>, I: 'static> PalletsInfoAccess for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> StorageInfoTrait for Pallet<T, I>
impl<T: Config<I>, I: 'static> StorageInfoTrait for Pallet<T, I>
fn storage_info() -> Vec<StorageInfo>
Source§impl<T: Config<I>, I: 'static> ViewFunctionIdPrefix for Pallet<T, I>
impl<T: Config<I>, I: 'static> ViewFunctionIdPrefix for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> WhitelistedStorageKeys for Pallet<T, I>
impl<T: Config<I>, I: 'static> WhitelistedStorageKeys for Pallet<T, I>
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Returns a
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.impl<T, I> Eq for Pallet<T, I>
Auto Trait Implementations§
impl<T, I> Freeze for Pallet<T, I>
impl<T, I> RefUnwindSafe for Pallet<T, I>where
T: RefUnwindSafe,
I: RefUnwindSafe,
impl<T, I> Send for Pallet<T, I>
impl<T, I> Sync for Pallet<T, I>
impl<T, I> Unpin for Pallet<T, I>
impl<T, I> UnwindSafe for Pallet<T, I>where
T: UnwindSafe,
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moreSource§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.