Type Definition pallet_balances::pallet::Account

source ·
pub type Account<T: Config<I>, I: 'static = ()> = StorageMap<_GeneratedPrefixForStorageAccount<T, I>, Blake2_128Concat, T::AccountId, AccountData<T::Balance>, ValueQuery>;
Expand description

The Balances pallet example of storing the balance of an account.

Example

 impl pallet_balances::Config for Runtime {
   type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
 }

You can also store the balance of an account in the System pallet.

Example

 impl pallet_balances::Config for Runtime {
  type AccountStore = System
 }

But this comes with tradeoffs, storing account balances in the system pallet stores frame_system data alongside the account data contrary to storing account balances in the Balances pallet, which uses a StorageMap to store balances data only. NOTE: This is only used in the case that this pallet is used to store balances.

Storage type is StorageMap with key type T :: AccountId and value type AccountData < T :: Balance >.