gupnik
60c77a2e9a
Adds syntax for marking calls feeless ( #1926 )
...
Fixes https://github.com/paritytech/polkadot-sdk/issues/1725
This PR adds the following changes:
1. An attribute `pallet::feeless_if` that can be optionally attached to
a call like so:
```rust
#[pallet::feeless_if(|_origin: &OriginFor<T>, something: &u32| -> bool {
*something == 0
})]
pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
....
}
```
The closure passed accepts references to arguments as specified in the
call fn. It returns a boolean that denotes the conditions required for
this call to be "feeless".
2. A signed extension `SkipCheckIfFeeless<T: SignedExtension>` that
wraps a transaction payment processor such as
`pallet_transaction_payment::ChargeTransactionPayment`. It checks for
all calls annotated with `pallet::feeless_if` to see if the conditions
are met. If so, the wrapped signed extension is not called, essentially
making the call feeless.
In order to use this, you can simply replace your existing signed
extension that manages transaction payment like so:
```diff
- pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
+ pallet_skip_feeless_payment::SkipCheckIfFeeless<
+ Runtime,
+ pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
+ >,
```
### Todo
- [x] Tests
- [x] Docs
- [x] Prdoc
---------
Co-authored-by: Nikhil Gupta <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com >
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com >
2023-11-13 19:14:41 +05:30
..
2023-11-13 19:14:41 +05:30
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-11-13 19:14:41 +05:30
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-11-13 19:14:41 +05:30
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-11-13 19:14:41 +05:30
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-10 16:02:35 +02:00
2023-10-10 16:02:35 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-27 11:38:16 +02:00
2023-10-27 11:38:16 +02:00
2023-10-14 08:26:19 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-09-22 12:48:48 +01:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-11-06 19:40:14 +01:00
2023-08-30 15:45:49 +03:00
2023-11-06 19:40:14 +01:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-10-11 19:49:59 +02:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00
2023-08-30 15:45:49 +03:00