referrerpolicy=no-referrer-when-downgrade

submit_price_authorized

Function submit_price_authorized 

Source
pub fn submit_price_authorized<T: Config>(
    _block_number: BlockNumberFor<T>,
    price: u32,
)
Expand description

Submit new price to the list via general transaction.

Works exactly like the submit_price function, but since we allow sending the transaction without a signature, and hence without paying any fees, we need a way to make sure that only some transactions are accepted. This function can be called only once every T::AuthorizedTxInterval blocks.

Transactions are de-duplicated on the pool level via the provides tag in the validation logic (validate_transaction_parameters), which returns next_authorized_at. This ensures only one transaction per interval can be included in a block.

It’s important to specify weight for authorized calls as well, because even though they don’t charge fees, we still don’t want a single block to contain unlimited number of such transactions.

This example is not focused on correctness of the oracle itself, but rather its purpose is to showcase offchain worker capabilities.

§Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::submit_price_authorized.