-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce and Implement
VestedTransfer
Trait (#5630)
This PR introduces a `VestedTransfer` Trait, which handles making a transfer while also applying a vesting schedule to that balance. This can be used in pallets like the Treasury pallet, where now we can easily introduce a `vested_spend` extrinsic as an alternative to giving all funds up front. We implement `()` for the `VestedTransfer` trait, which just returns an error, and allows anyone to opt out from needing to use or implement this trait. This PR also updates the logic of `do_vested_transfer` to remove the "pre-check" which was needed before we had a default transactional layer in FRAME. Finally, I also fixed up some bad formatting in the test.rs file. --------- Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de>
- Loading branch information
1 parent
118d24b
commit 43cb7c7
Showing
7 changed files
with
182 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: Introduce and Implement the `VestedTransfer` Trait | ||
|
||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
This PR introduces a new trait `VestedTransfer` which is implemented by `pallet_vesting`. With this, other pallets can easily introduce vested transfers into their logic. | ||
|
||
crates: | ||
- name: frame-support | ||
bump: minor | ||
- name: pallet-vesting | ||
bump: minor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.