Enum pallet_chainlink_feed::pallet::Call [−][src]
pub enum Call<T: Config> {
Show 23 variants
create_feed {
payment: BalanceOf<T>,
timeout: T::BlockNumber,
submission_value_bounds: (T::Value, T::Value),
min_submissions: u32,
decimals: u8,
description: Vec<u8>,
restart_delay: u32,
oracles: Vec<(T::AccountId, T::AccountId)>,
pruning_window: Option<u32>,
max_debt: Option<BalanceOf<T>>,
},
transfer_ownership {
feed_id: T::FeedId,
new_owner: T::AccountId,
},
cancel_ownership_transfer {
feed_id: T::FeedId,
},
accept_ownership {
feed_id: T::FeedId,
},
set_pruning_window {
feed_id: T::FeedId,
pruning_window: u32,
},
submit {
feed_id: T::FeedId,
round_id: RoundId,
submission: T::Value,
},
change_oracles {
feed_id: T::FeedId,
to_disable: Vec<T::AccountId>,
to_add: Vec<(T::AccountId, T::AccountId)>,
},
update_future_rounds {
feed_id: T::FeedId,
payment: BalanceOf<T>,
submission_count_bounds: (u32, u32),
restart_delay: u32,
timeout: T::BlockNumber,
},
set_requester {
feed_id: T::FeedId,
requester: T::AccountId,
delay: RoundId,
},
remove_requester {
feed_id: T::FeedId,
requester: T::AccountId,
},
request_new_round {
feed_id: T::FeedId,
},
withdraw_payment {
oracle: T::AccountId,
recipient: T::AccountId,
amount: BalanceOf<T>,
},
transfer_admin {
oracle: T::AccountId,
new_admin: T::AccountId,
},
cancel_admin_transfer {
oracle: T::AccountId,
},
accept_admin {
oracle: T::AccountId,
},
withdraw_funds {
recipient: T::AccountId,
amount: BalanceOf<T>,
},
reduce_debt {
feed_id: T::FeedId,
amount: BalanceOf<T>,
},
force_set_pallet_admin {
new_pallet_admin: T::AccountId,
},
transfer_pallet_admin {
new_pallet_admin: T::AccountId,
},
cancel_pallet_admin_transfer {},
accept_pallet_admin {},
set_feed_creator {
new_creator: T::AccountId,
},
remove_feed_creator {
creator: T::AccountId,
},
// some variants omitted
}
Expand description
Contains one variant per dispatchable that can be called by an extrinsic.
Variants
Create a new oracle feed with the given config values.
This will issue the next available feed ID (FeedCounter
) and
assign it to the new feed.
Limited to feed creator accounts that where granted permission by
the pallet admin to create feeds via set_feed_creator
.
Parameters:
payment
: The amount of funds an oracle should received per valid round submission.timeout
: The timeout in blocks, after which a started round is timed out. If a round started in blockn
and the feed’stimeout
is10
, then the round is timed out ifn + 10 < current_block
.submission_value_bounds
: The value bounds of oracle submissions that are considered valid.min_submissions
: Determines the lower end of the feed’ssubmission_count_bounds
where the maximum number of submissions a round records is the number of configured oracles and the lower end is the minimum amount of submissions a round needs to update an answer viaAnswerUpdated
event.decimals
: Metadata that represents the number of decimals with which the feed is configured.description
: A user friendly name or ticker of this feed. Limited in length byStringLimit
.restart_delay
: The number of rounds that must elapse before a new round can be initiated by the same oracle again. Therefore this must be lower than the number of provided oracles.oracles
: A list of the oracle accounts together with their admin account (oracle
,admin
) that will be registered as oracles for the feed. If the oracle account is already tracked (for another feed for example), then the provided admin must match the already tracked oracle’s admin (seeOracles
). At least one (oracle
,admin
) pair is required.pruning_window
: This specifies the number of rounds to keep in storage for this feed. ANone
ensures that no past rounds are ever deleted from the chain’s storage. A value ofSome(n)
ensures thatn
rounds are kept in storage after the total number of rounds has exceededn
. This means that starting with then+1
round, the oldest round is purged from storage.max_debt
: WithSome(n)
the feed is allowed to accumulate a less or equal thann
amount of debt to the oracles. This means that oracles can submit values even if the feed’s fund is dry, and essentially receive an IOU that they can cash in once the feed is refunded.
Emits FeedCreated
event when successful.
Fields of create_feed
Initiate the transfer of the feed to new_owner
.
Limited to the current owner of the feed.
This is a noop if the requested new_owner
is the sender itself
and the sender is already the owner.
Cancels a previously with transfer_ownership
initiated transfer of
ownership if it’s still pending.
This will fail if the pending_owner
already accepted the transfer
with accept_ownership
..
Fields of cancel_ownership_transfer
feed_id: T::FeedId
Accept the transfer of feed ownership.
Fields of accept_ownership
feed_id: T::FeedId
Updates the pruning window of an existing feed
- Will prune rounds if the given window is smaller than the existing one.
Submit a new value to the given feed and round.
- Will start a new round if there is no round for the id, yet, and a round can be started (at this time by this oracle).
- Will update the round answer if minimum number of submissions has been reached.
- Records the rewards incurred by the oracle.
- Removes the details for the previous round if it was superseded.
Limited to the oracles of a feed.
Disable and add oracles for the given feed. Limited to the owner of a feed.
Fields of change_oracles
Update the configuration for future oracle rounds. Limited to the owner of a feed.
Fields of update_future_rounds
Set requester permissions for requester
.
Limited to the feed owner.
Remove requester permissions for requester
.
Limited to the feed owner.
Request the start of a new oracle round. Limited to accounts with “requester” permission.
Fields of request_new_round
feed_id: T::FeedId
Withdraw amount
payment of the given oracle to recipient
.
Limited to the oracle admin.
Initiate an admin transfer for the given oracle. Limited to the oracle admin account.
This is a noop if the requested new_admin
is the sender itself
and the sender is already the oracle admin.
Cancels a previously with transfer_admin
initiated transfer of
admin ownership for the given oracle, if the transfer is still
pending.
This will fail if the pending_admin
already accepted the transfer
with accept_admin
..
Fields of cancel_admin_transfer
oracle: T::AccountId
Complete an admin transfer for the given oracle. Limited to the pending oracle admin account.
Fields of accept_admin
oracle: T::AccountId
Withdraw amount
funds to recipient
.
Limited to the pallet admin.
Reduce the amount of debt in the pallet by moving funds from the free balance to the reserved so oracles can be payed out. Limited to the pallet admin.
Sets the pallet admin account.
The dispatch origin for this call must be Root.
Unlike transfer_pallet_admin
, the new_pallet_admin
is not
required to accept the transfer, instead the PalletAdmin
is
forcibly set and the eventual pending transfer is aborted.
Fields of force_set_pallet_admin
new_pallet_admin: T::AccountId
Initiate an admin transfer for the pallet. Limited to the pallet admin account.
This is a noop if the requested new_pallet_admin
is the sender
itself and the sender is already the pallet admin.
Fields of transfer_pallet_admin
new_pallet_admin: T::AccountId
Cancels a previously with transfer_pallet_admin
initiated transfer
of the pallet admin ownership, if the transfer is still pending.
This will fail if the PendingPalletAdmin
already accepted the
transfer with accept_pallet_admin
.
Fields of cancel_pallet_admin_transfer
Complete an admin transfer for the pallet. Limited to the pending pallet admin account.
Fields of accept_pallet_admin
Allow the given account to create oracle feeds. Limited to the pallet admin account.
Fields of set_feed_creator
new_creator: T::AccountId
Disallow the given account to create oracle feeds. Limited to the pallet admin account.
Fields of remove_feed_creator
creator: T::AccountId
Implementations
pub fn new_call_variant_create_feed(
payment: BalanceOf<T>,
timeout: T::BlockNumber,
submission_value_bounds: (T::Value, T::Value),
min_submissions: u32,
decimals: u8,
description: Vec<u8>,
restart_delay: u32,
oracles: Vec<(T::AccountId, T::AccountId)>,
pruning_window: Option<u32>,
max_debt: Option<BalanceOf<T>>
) -> Self
pub fn new_call_variant_create_feed(
payment: BalanceOf<T>,
timeout: T::BlockNumber,
submission_value_bounds: (T::Value, T::Value),
min_submissions: u32,
decimals: u8,
description: Vec<u8>,
restart_delay: u32,
oracles: Vec<(T::AccountId, T::AccountId)>,
pruning_window: Option<u32>,
max_debt: Option<BalanceOf<T>>
) -> Self
Create a call with the variant create_feed
.
pub fn new_call_variant_transfer_ownership(
feed_id: T::FeedId,
new_owner: T::AccountId
) -> Self
pub fn new_call_variant_transfer_ownership(
feed_id: T::FeedId,
new_owner: T::AccountId
) -> Self
Create a call with the variant transfer_ownership
.
Create a call with the variant cancel_ownership_transfer
.
Create a call with the variant accept_ownership
.
Create a call with the variant set_pruning_window
.
pub fn new_call_variant_submit(
feed_id: T::FeedId,
round_id: RoundId,
submission: T::Value
) -> Self
pub fn new_call_variant_submit(
feed_id: T::FeedId,
round_id: RoundId,
submission: T::Value
) -> Self
Create a call with the variant submit
.
Create a call with the variant change_oracles
.
pub fn new_call_variant_update_future_rounds(
feed_id: T::FeedId,
payment: BalanceOf<T>,
submission_count_bounds: (u32, u32),
restart_delay: u32,
timeout: T::BlockNumber
) -> Self
pub fn new_call_variant_update_future_rounds(
feed_id: T::FeedId,
payment: BalanceOf<T>,
submission_count_bounds: (u32, u32),
restart_delay: u32,
timeout: T::BlockNumber
) -> Self
Create a call with the variant update_future_rounds
.
pub fn new_call_variant_set_requester(
feed_id: T::FeedId,
requester: T::AccountId,
delay: RoundId
) -> Self
pub fn new_call_variant_set_requester(
feed_id: T::FeedId,
requester: T::AccountId,
delay: RoundId
) -> Self
Create a call with the variant set_requester
.
Create a call with the variant remove_requester
.
Create a call with the variant request_new_round
.
pub fn new_call_variant_withdraw_payment(
oracle: T::AccountId,
recipient: T::AccountId,
amount: BalanceOf<T>
) -> Self
pub fn new_call_variant_withdraw_payment(
oracle: T::AccountId,
recipient: T::AccountId,
amount: BalanceOf<T>
) -> Self
Create a call with the variant withdraw_payment
.
Create a call with the variant transfer_admin
.
Create a call with the variant cancel_admin_transfer
.
Create a call with the variant accept_admin
.
Create a call with the variant withdraw_funds
.
Create a call with the variant reduce_debt
.
Create a call with the variant force_set_pallet_admin
.
Create a call with the variant transfer_pallet_admin
.
Create a call with the variant cancel_pallet_admin_transfer
.
Create a call with the variant accept_pallet_admin
.
Create a call with the variant set_feed_creator
.
Create a call with the variant remove_feed_creator
.
Trait Implementations
Return the function name of the Call.
Return all function names.
Return a DispatchInfo
, containing relevant information of this dispatch. Read more
impl<T: Config> TypeInfo for Call<T> where
PhantomData<(T,)>: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::BlockNumber: TypeInfo + 'static,
(T::Value, T::Value): TypeInfo + 'static,
Vec<(T::AccountId, T::AccountId)>: TypeInfo + 'static,
Option<BalanceOf<T>>: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::FeedId: HasCompact,
T::Value: HasCompact,
T::FeedId: TypeInfo + 'static,
Vec<T::AccountId>: TypeInfo + 'static,
Vec<(T::AccountId, T::AccountId)>: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::BlockNumber: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T: Config + 'static,
impl<T: Config> TypeInfo for Call<T> where
PhantomData<(T,)>: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::BlockNumber: TypeInfo + 'static,
(T::Value, T::Value): TypeInfo + 'static,
Vec<(T::AccountId, T::AccountId)>: TypeInfo + 'static,
Option<BalanceOf<T>>: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::FeedId: HasCompact,
T::Value: HasCompact,
T::FeedId: TypeInfo + 'static,
Vec<T::AccountId>: TypeInfo + 'static,
Vec<(T::AccountId, T::AccountId)>: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::BlockNumber: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::FeedId: TypeInfo + 'static,
BalanceOf<T>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T: Config + 'static,
Dispatch this call but do not check the filter in origin.
Auto Trait Implementations
impl<T> RefUnwindSafe for Call<T> where
T: RefUnwindSafe,
<T as Config>::AccountId: RefUnwindSafe,
<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance: RefUnwindSafe,
<T as Config>::BlockNumber: RefUnwindSafe,
<T as Config>::FeedId: RefUnwindSafe,
<T as Config>::Value: RefUnwindSafe,
impl<T> Send for Call<T> where
T: Send,
<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance: Send,
impl<T> Sync for Call<T> where
T: Sync,
<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance: Sync,
impl<T> Unpin for Call<T> where
T: Unpin,
<T as Config>::AccountId: Unpin,
<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance: Unpin,
<T as Config>::BlockNumber: Unpin,
<T as Config>::FeedId: Unpin,
<T as Config>::Value: Unpin,
impl<T> UnwindSafe for Call<T> where
T: UnwindSafe,
<T as Config>::AccountId: UnwindSafe,
<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance: UnwindSafe,
<T as Config>::BlockNumber: UnwindSafe,
<T as Config>::FeedId: UnwindSafe,
<T as Config>::Value: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Compare self to key
and return true
if they are equal.
Causes self
to use its Binary
implementation when Debug
-formatted.
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
Causes self
to use its Octal
implementation when Debug
-formatted.
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
Pipes by value. This is generally the method you want to use. Read more
Borrows self
and passes that borrow into the pipe function. Read more
Mutably borrows self
and passes that borrow into the pipe function. Read more
Borrows self
, then passes self.borrow()
into the pipe function. Read more
Mutably borrows self
, then passes self.borrow_mut()
into the pipe
function. Read more
Borrows self
, then passes self.as_ref()
into the pipe function.
Mutably borrows self
, then passes self.as_mut()
into the pipe
function. Read more
Borrows self
, then passes self.deref()
into the pipe function.
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.
Immutable access to the Borrow<B>
of a value. Read more
Mutable access to the BorrowMut<B>
of a value. Read more
Immutable access to the AsRef<R>
view of a value. Read more
Mutable access to the AsMut<R>
view of a value. Read more
Immutable access to the Deref::Target
of a value. Read more
Mutable access to the Deref::Target
of a value. Read more
Calls .tap()
only in debug builds, and is erased in release builds.
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_borrow()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_ref()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more
Calls .tap_deref()
only in debug builds, and is erased in release
builds. Read more
Provides immutable access to the reference for inspection.
Calls tap_ref
in debug builds, and does nothing in release builds.
Provides mutable access to the reference for modification.
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
Provides immutable access to the borrow for inspection. Read more
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more