I have currency configuration as follows
use frame_support::traits::{Currency};
and in frame config
type Currency: Currency<Self::AccountId>;
Then in an extrincis function, I am trying to do a transfer
<T as Config>::Currency::transfer(
&who,
&validators_account,
transaction_fee,
ExistenceRequirement::KeepAlive
)?;
This throws an error
--> /home/dev/Desktop/projects/GIANT/pallets/provider/src/lib.rs:281:5
|
278 | <T as Config>::Currency::transfer(
| --------------------------------- arguments to this function are incorrect
...
281 | transaction_fee,
| ^^^^^^^^^^^^^^^ expected associated type, found `u128`
|
= note: expected associated type `<<T as pallet::Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance`
found type `u128`
But when I explore tests for transfer function in the substrate it uses integer values
assert_noop!(
<Balances as Currency<_>>::transfer(&1, &2, 3, AllowDeath),
Error::<$test, _>::LiquidityRestrictions
);
This throws an error as well
<T as Config>::Currency::transfer(
&who,
&validators_account,
100,
ExistenceRequirement::KeepAlive
)?;
Error
<T as Config>::Currency::transfer(
| --------------------------------- arguments to this function are incorrect
...
281 | 100,
| ^^^ expected associated type, found integer
|
How to fix this issue?