Replace bitmask with bitflags (#7159)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
Qinxuan Chen
2020-10-29 20:19:59 +08:00
committed by GitHub
parent c8a245e5e0
commit bd450c24ff
15 changed files with 67 additions and 80 deletions
+4 -4
View File
@@ -162,7 +162,7 @@ use frame_support::{
decl_module, decl_storage, decl_event, decl_error, ensure, Parameter,
weights::{Weight, DispatchClass, Pays},
traits::{
Currency, ReservableCurrency, LockableCurrency, WithdrawReason, LockIdentifier, Get,
Currency, ReservableCurrency, LockableCurrency, WithdrawReasons, LockIdentifier, Get,
OnUnbalanced, BalanceStatus, schedule::{Named as ScheduleNamed, DispatchTime}, EnsureOrigin
},
dispatch::DispatchResultWithPostInfo,
@@ -1278,7 +1278,7 @@ impl<T: Trait> Module<T> {
DEMOCRACY_ID,
who,
vote.balance(),
WithdrawReason::Transfer.into()
WithdrawReasons::TRANSFER
);
ReferendumInfoOf::<T>::insert(ref_index, ReferendumInfo::Ongoing(status));
Ok(())
@@ -1410,7 +1410,7 @@ impl<T: Trait> Module<T> {
DEMOCRACY_ID,
&who,
balance,
WithdrawReason::Transfer.into()
WithdrawReasons::TRANSFER
);
Ok(votes)
})?;
@@ -1461,7 +1461,7 @@ impl<T: Trait> Module<T> {
if lock_needed.is_zero() {
T::Currency::remove_lock(DEMOCRACY_ID, who);
} else {
T::Currency::set_lock(DEMOCRACY_ID, who, lock_needed, WithdrawReason::Transfer.into());
T::Currency::set_lock(DEMOCRACY_ID, who, lock_needed, WithdrawReasons::TRANSFER);
}
}