File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
substrate/frame/transaction-payment/src Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -711,9 +711,11 @@ impl<T: Config> Pallet<T> {
711
711
/// # Warning
712
712
///
713
713
/// This is only useful if a pallet knows that the pre-dispatch weight was vastly
714
- /// overestimated. Drawing too much balance will cause the signer to underpay for the
715
- /// transaction. Too much means that not enough is left to pay for the fee with regard
716
- /// to the post dispatch weight.
714
+ /// overestimated. Pallets need to make sure to leave enough balance to pay for the
715
+ /// transaction fees. They can do that by first drawing as much as they need and then
716
+ /// at the end of the transaction (when they know the post dispatch fee) return an error
717
+ /// in case not enough is left. The error will automatically roll back all the storage
718
+ /// changes done by the pallet including the balance drawn by calling this function.
717
719
pub fn withdraw_txfee < Balance > ( amount : Balance ) -> Option < CreditOf < T > >
718
720
where
719
721
CreditOf < T > : Imbalance < Balance > ,
You can’t perform that action at this time.
0 commit comments