|
29 | 29 | use codec::{Decode, Encode, HasCompact}; |
30 | 30 | use frame_support::{ |
31 | 31 | decl_error, decl_event, decl_module, decl_storage, ensure, |
32 | | - traits::{Currency, ExistenceRequirement, Get, LockIdentifier, LockableCurrency, WithdrawReasons}, |
| 32 | + traits::{Currency, EnsureOrigin, ExistenceRequirement, Get, LockIdentifier, LockableCurrency, WithdrawReasons}, |
33 | 33 | weights::Weight, |
34 | 34 | }; |
35 | 35 | use frame_system::{ensure_root, ensure_signed}; |
@@ -122,6 +122,9 @@ pub trait Trait: frame_system::Trait { |
122 | 122 | /// The minimum amount transferred to call `vested_transfer`. |
123 | 123 | type MinVestedTransfer: Get<BalanceOf<Self>>; |
124 | 124 |
|
| 125 | + /// Required origin for vested transfer. |
| 126 | + type VestedTransferOrigin: EnsureOrigin<Self::Origin, Success = Self::AccountId>; |
| 127 | + |
125 | 128 | /// Weight information for extrinsics in this module. |
126 | 129 | type WeightInfo: WeightInfo; |
127 | 130 | } |
@@ -220,7 +223,7 @@ decl_module! { |
220 | 223 | dest: <T::Lookup as StaticLookup>::Source, |
221 | 224 | schedule: VestingScheduleOf<T>, |
222 | 225 | ) { |
223 | | - let from = ensure_signed(origin)?; |
| 226 | + let from = T::VestedTransferOrigin::ensure_origin(origin)?; |
224 | 227 | let to = T::Lookup::lookup(dest)?; |
225 | 228 | Self::do_vested_transfer(&from, &to, schedule.clone())?; |
226 | 229 |
|
|
0 commit comments