-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Pallets: Treasury spends various asset kinds #14434
base: master
Are you sure you want to change the base?
Conversation
This reverts commit bfccac0.
@@ -15,53 +15,69 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
//! > Made with *Substrate*, for *Polkadot*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated according to the guidelines https://github.com/paritytech/substrate/blob/master/docs/DOCUMENTATION_GUIDELINES.md#pallet-crates
The CI pipeline was cancelled due to failure one of the required jobs. |
bot rebase |
Rebased |
bot rebase |
Rebased |
let native_amount = T::BalanceConverter::from_asset_balance(amount, asset_kind.clone()) | ||
.map_err(|_| Error::<T, I>::FailedToConvertBalance)?; | ||
|
||
ensure!(native_amount <= max_amount, Error::<T, I>::InsufficientPermission); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not superfluous with the next block in place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it runs with context only if dispatched via UnfilteredDispatchable::dispatch_bypass_filter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good modulo the comments.
Treasury Pallet can accept proposals for
spends
of variousasset kinds
and pay them out through the implementation of thePay
trait.New Dispatchables:
The parameters' types of the
spend
dispatchable exposed via the pallet'sConfig
and allows to propose and accept a spend of a certain amount.An approved spend can be claimed via the
payout
within theConfig::SpendPeriod
. Clients provide an implementation of thePay
trait which can pay an asset of theAssetKind
to theBeneficiary
.The implementation of the
Pay
trait might not have an immediate final payment status, for example if implemented over XCM and the actual transfer happens on a remote chain.The
check_status
dispatchable can be executed to update the spend's payment state and retry thepayout
if the payment has failed.polkadot companion: paritytech/polkadot#7427
Closes paritytech/polkadot-sdk#92