In my runtime, one pallet reserves some currency using the orml-currencies pallet on genesis, and for this, it depends on accounts having some initial balance. This should be provided by the genesis config of the orml-tokens module

For reference, this is my genesis config for the orml-tokens module

        tokens: parachain_template_runtime::TokensConfig {
            balances: endowed_accounts
            .flat_map(|x| {
                    (x.clone(), CurrencyId::DOT, ENDOWMENT),
                    (x.clone(), CurrencyId::BTC, ENDOWMENT),

And my runtime config for orml-currencies

parameter_types! {
    pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native;

impl orml_currencies::Config for Runtime {
    type MultiCurrency = Tokens;
    type NativeCurrency = BasicCurrencyAdapter<Runtime, Balances, Amount, BlockNumber>;
    type GetNativeCurrencyId = GetNativeCurrencyId;
    type WeightInfo = ();

When I set the currencyId of the genesis run of the extrinsic to Native, the reserve works.

Strangely, when I use a different currencyId, the reserve doesn't work. The extrinsic throws an "InsufficientBalance" Error.

To take things further, when I try the exact same extrinsic after genesis with a new account that's funded with some currency (e.g DOT) by one of the accounts intialised on genesis, the extrinsic works


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.