mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-16 22:25:43 +00:00
Replace bitmask with bitflags (#7159)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -35,7 +35,7 @@ fn add_locks<T: Trait>(who: &T::AccountId, n: u8) {
|
||||
for id in 0..n {
|
||||
let lock_id = [id; 8];
|
||||
let locked = 100u32;
|
||||
let reasons = WithdrawReason::Transfer | WithdrawReason::Reserve;
|
||||
let reasons = WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE;
|
||||
T::Currency::set_lock(lock_id, who, locked.into(), reasons);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ use sp_runtime::{DispatchResult, RuntimeDebug, traits::{
|
||||
}};
|
||||
use frame_support::{decl_module, decl_event, decl_storage, decl_error, ensure};
|
||||
use frame_support::traits::{
|
||||
Currency, LockableCurrency, VestingSchedule, WithdrawReason, LockIdentifier,
|
||||
Currency, LockableCurrency, VestingSchedule, WithdrawReasons, LockIdentifier,
|
||||
ExistenceRequirement, Get,
|
||||
};
|
||||
use frame_system::{ensure_signed, ensure_root};
|
||||
@@ -148,7 +148,7 @@ decl_storage! {
|
||||
per_block: per_block,
|
||||
starting_block: begin
|
||||
});
|
||||
let reasons = WithdrawReason::Transfer | WithdrawReason::Reserve;
|
||||
let reasons = WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE;
|
||||
T::Currency::set_lock(VESTING_ID, who, locked, reasons);
|
||||
}
|
||||
})
|
||||
@@ -322,7 +322,7 @@ impl<T: Trait> Module<T> {
|
||||
Vesting::<T>::remove(&who);
|
||||
Self::deposit_event(RawEvent::VestingCompleted(who));
|
||||
} else {
|
||||
let reasons = WithdrawReason::Transfer | WithdrawReason::Reserve;
|
||||
let reasons = WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE;
|
||||
T::Currency::set_lock(VESTING_ID, &who, locked_now, reasons);
|
||||
Self::deposit_event(RawEvent::VestingUpdated(who, locked_now));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user