如何将 u128 转换为余额?
How to convert u128 to Balance?
如何将 u128 转换为余额?
use frame_support::{
traits::{Currency, ExistenceRequirement, Get, ReservableCurrency, WithdrawReasons},
};
type BalanceOf<T> = <<T as Config>::Currency as Currency<AccountIdOf<T>>>::Balance;
#[pallet::type_value]
pub fn DefaultRegistrationFees<T: Config>() -> BalanceOf<T> { 100 }
错误:
lib.rs(79, 67): 预期关联类型,找到整数
试过这个方法:
100.into() 不起作用。
我是否必须使用 configurable pallet constant 在运行时声明?
如何将 u128 转换为余额?
use frame_support::{
traits::{Currency, ExistenceRequirement, Get, ReservableCurrency, WithdrawReasons},
};
type BalanceOf<T> = <<T as Config>::Currency as Currency<AccountIdOf<T>>>::Balance;
#[pallet::type_value]
pub fn DefaultRegistrationFees<T: Config>() -> BalanceOf<T> { 100 }
错误:
lib.rs(79, 67): 预期关联类型,找到整数
试过这个方法:
100.into() 不起作用。
我是否必须使用 configurable pallet constant 在运行时声明?