@@ -40,7 +40,7 @@ pub trait OnChargeAssetTransaction<T: Config> {
40
40
/// The underlying integer type in which fees are calculated.
41
41
type Balance : Balance ;
42
42
/// The type used to identify the assets used for transaction payment.
43
- type AssetId : FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + Eq + TypeInfo ;
43
+ type AssetId : FullCodec + Clone + MaybeSerializeDeserialize + Debug + Default + Eq + TypeInfo ;
44
44
/// The type used to store the intermediate values between pre- and post-dispatch.
45
45
type LiquidityInfo ;
46
46
@@ -112,7 +112,7 @@ where
112
112
T : Config ,
113
113
CON : ConversionToAssetBalance < BalanceOf < T > , AssetIdOf < T > , AssetBalanceOf < T > > ,
114
114
HC : HandleCredit < T :: AccountId , T :: Fungibles > ,
115
- AssetIdOf < T > : FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + Eq + TypeInfo ,
115
+ AssetIdOf < T > : FullCodec + Clone + MaybeSerializeDeserialize + Debug + Default + Eq + TypeInfo ,
116
116
{
117
117
type Balance = BalanceOf < T > ;
118
118
type AssetId = AssetIdOf < T > ;
@@ -133,11 +133,14 @@ where
133
133
// less than one (e.g. 0.5) but gets rounded down by integer division we introduce a minimum
134
134
// fee.
135
135
let min_converted_fee = if fee. is_zero ( ) { Zero :: zero ( ) } else { One :: one ( ) } ;
136
- let converted_fee = CON :: to_asset_balance ( fee, asset_id)
136
+ let converted_fee = CON :: to_asset_balance ( fee, asset_id. clone ( ) )
137
137
. map_err ( |_| TransactionValidityError :: from ( InvalidTransaction :: Payment ) ) ?
138
138
. max ( min_converted_fee) ;
139
- let can_withdraw =
140
- <T :: Fungibles as Inspect < T :: AccountId > >:: can_withdraw ( asset_id, who, converted_fee) ;
139
+ let can_withdraw = <T :: Fungibles as Inspect < T :: AccountId > >:: can_withdraw (
140
+ asset_id. clone ( ) ,
141
+ who,
142
+ converted_fee,
143
+ ) ;
141
144
if can_withdraw != WithdrawConsequence :: Success {
142
145
return Err ( InvalidTransaction :: Payment . into ( ) )
143
146
}
@@ -167,7 +170,7 @@ where
167
170
// less than one (e.g. 0.5) but gets rounded down by integer division we introduce a minimum
168
171
// fee.
169
172
let min_converted_fee = if fee. is_zero ( ) { Zero :: zero ( ) } else { One :: one ( ) } ;
170
- let converted_fee = CON :: to_asset_balance ( fee, asset_id)
173
+ let converted_fee = CON :: to_asset_balance ( fee, asset_id. clone ( ) )
171
174
. map_err ( |_| TransactionValidityError :: from ( InvalidTransaction :: Payment ) ) ?
172
175
. max ( min_converted_fee) ;
173
176
let can_withdraw =
0 commit comments