From ea8b87747e1d630d9c84e6beb4f2af6841896991 Mon Sep 17 00:00:00 2001
From: wangjj9219 <183318287@qq.com>
Date: Wed, 27 May 2020 15:29:46 +0800
Subject: [PATCH] modify WithdrawReason to adapt pallet_balances (#186)

---
 currencies/src/lib.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/currencies/src/lib.rs b/currencies/src/lib.rs
index 0b720b4..67b5f62 100644
--- a/currencies/src/lib.rs
+++ b/currencies/src/lib.rs
@@ -35,7 +35,7 @@ use frame_support::{
 	decl_error, decl_event, decl_module, decl_storage,
 	traits::{
 		Currency as PalletCurrency, ExistenceRequirement, Get, LockableCurrency as PalletLockableCurrency,
-		ReservableCurrency as PalletReservableCurrency, WithdrawReason,
+		ReservableCurrency as PalletReservableCurrency, WithdrawReasons,
 	},
 };
 use sp_runtime::{
@@ -555,7 +555,7 @@ where
 			BalanceConvert::from(new_balance).into()
 		};
 		let amount_pallet = BalanceConvert::from(amount).into();
-		Currency::ensure_can_withdraw(who, amount_pallet, WithdrawReason::Transfer.into(), new_balance_pallet)
+		Currency::ensure_can_withdraw(who, amount_pallet, WithdrawReasons::all(), new_balance_pallet)
 	}
 
 	fn transfer(from: &AccountId, to: &AccountId, amount: Self::Balance) -> DispatchResult {
@@ -572,7 +572,7 @@ where
 		Currency::withdraw(
 			who,
 			BalanceConvert::from(amount).into(),
-			WithdrawReason::Transfer.into(),
+			WithdrawReasons::all(),
 			ExistenceRequirement::AllowDeath,
 		)
 		.map(|_| ())
@@ -632,7 +632,7 @@ where
 			lock_id,
 			who,
 			BalanceConvert::from(amount).into(),
-			WithdrawReason::Transfer | WithdrawReason::Reserve,
+			WithdrawReasons::all(),
 		);
 	}
 
@@ -641,7 +641,7 @@ where
 			lock_id,
 			who,
 			BalanceConvert::from(amount).into(),
-			WithdrawReason::Transfer | WithdrawReason::Reserve,
+			WithdrawReasons::all(),
 		);
 	}
 
-- 
GitLab