느슨한 팔레트 결합 사용하기
Last updated
use frame_support::traits::Currency;pub trait Config: frame_system::Config {
// --snip--
/// 우리의 느슨하게 결합된 팔레트 `my-pallet`에 액세스하는 타입
type LocalCurrency: Currency<Self::AccountId>;
}// `my-pallet`에서 게터를 사용합니다.
let total_balance = T::LocalCurrency::total_issuance();impl my_pallet::Config for Runtime {
type LocalCurrency = Balances;
}construct_runtime! (
pub enum Runtime where
Block = Block,
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
Balances: pallet_balances,
}
)