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 tipreason
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 thewho
.
Emits TipClosing
if the threshold of tippers has been reached and the countdown period
has started.
Complexity
-
O(T)
whereT
is the number of tippers. decodingTipper
vec of lengthT
, insert tip and check closing,T
is charged as upper bound given byContainsLengthBound
. The actual cost depends on the implementation ofT::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 lengthT-1
.
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::tip
.