referrerpolicy=no-referrer-when-downgrade

Function pallet_tips::pallet::dispatchables::tip

source ·
pub fn tip<T: Config<I>, I: 'static>(hash: T::Hash, tip_value: BalanceOf<T, I>)
Expand description

Declare a tip value for an already-open tip.

The dispatch origin for this call must be Signed and the signing account must be a member of the Tippers set.

  • hash: The identity of the open tip for which a tip value is declared. This is formed as the hash of the tuple of the hash of the original tip reason and the beneficiary account ID.
  • tip_value: The amount of tip that the sender would like to give. The median tip value of active tippers will be given to the who.

Emits TipClosing if the threshold of tippers has been reached and the countdown period has started.

§Complexity

  • O(T) where T is the number of tippers. decoding Tipper vec of length T, insert tip and check closing, T is charged as upper bound given by ContainsLengthBound. The actual cost depends on the implementation of T::Tippers.

    Actually weight could be lower as it depends on how many tips are in OpenTip but it is weighted as if almost full i.e of length T-1.

§Warning: Doc-Only

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