Struct pallet_chainlink_feed::pallet::Pallet[][src]

pub struct Pallet<T>(_);
Expand description

The pallet implementing the on-chain logic.

Implementations

Get debt by FeedId

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 block n and the feed’s timeout is 10, then the round is timed out if n + 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’s submission_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 via AnswerUpdated 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 by StringLimit.
  • 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 (see Oracles). At least one (oracle, admin) pair is required.
  • pruning_window: This specifies the number of rounds to keep in storage for this feed. A None ensures that no past rounds are ever deleted from the chain’s storage. A value of Some(n) ensures that n rounds are kept in storage after the total number of rounds has exceeded n. This means that starting with the n+1 round, the oldest round is purged from storage.
  • max_debt: With Some(n) the feed is allowed to accumulate a less or equal than n 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.

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..

Accept the transfer of feed ownership.

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.

Update the configuration for future oracle rounds. Limited to the owner of a feed.

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.

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..

Complete an admin transfer for the given oracle. Limited to the pending oracle admin account.

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.

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.

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.

Complete an admin transfer for the pallet. Limited to the pending pallet admin account.

Allow the given account to create oracle feeds. Limited to the pallet admin account.

Disallow the given account to create oracle feeds. Limited to the pallet admin account.

The account controlling the funds for this pallet.

A running counter used internally to determine the next feed id.

A running counter used internally to determine the next feed id.

User-facing round data.

Operator-facing round data.

Global oracle meta data including admin and withdrawable funds.

Feed local oracle status data.

Per-feed permissioning for starting new rounds.

Trait Implementations

Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more

Run the benchmarks for this pallet.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Return a transient feed proxy object for interacting with the feed given by the id. Provides read-only access.

Return a transient feed proxy object for interacting with the feed given by the id. Provides read-write access.

Returns the current storage version as supported by the pallet.

Returns the on-chain storage version of the pallet as stored in the storage.

The block is being finalized. Implement to have something happen.

This will be run when the block is being finalized (before on_finalize). Implement to have something happen using the remaining weight. Will not fire if the remaining weight is 0. Return the weight used, the hook will subtract it from current weight used and pass the result to the next on_idle hook if it exists. Read more

The block is being initialized. Implement to have something happen. Read more

Perform a module upgrade. Read more

Implementing this function on a module allows you to perform long-running tasks that make (by default) validators generate transactions that feed results of those long-running computations back on chain. Read more

Run integrity test. Read more

Run integrity test. Read more

This function is being called after every block import (when fully synced). Read more

The block is being finalized. Implement to have something happen. Read more

Something that should happen at genesis.

The block is being finalized. Implement to have something happen in case there is leftover weight. Check the passed remaining_weight to make sure it is high enough to allow for your pallet’s extra computation. Read more

The block is being initialized. Implement to have something happen. Read more

Perform a module upgrade. Read more

Index of the pallet as configured in the runtime.

Name of the pallet as configured in the runtime.

Name of the Rust module containing the pallet.

Version of the crate containing the pallet.

The number of pallets’ information that this type represents. Read more

Extend the given vector by all of the pallets’ information that this type represents. Read more

All of the pallets’ information that this type represents.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

Converts self into T using Into<T>. Read more

Converts self into a target type. 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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. 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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Cast reference.

Cast reference.

Cast mutable reference.

Cast mutable reference.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

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.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable 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

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. 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 a value. Read more

Mutable access to a value. Read more

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

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

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.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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