duality-labs / duality

Apache License 2.0
10 stars 5 forks source link

fix bankKeeper initialization steps #284

Closed MSalopek closed 1 year ago

MSalopek commented 1 year ago

This PR attempts to fix failing interchain security related e2e tests.

Outline of the issue:

In app.go bankKeeper setup, the module account handling outgoing fees (from consumer to provider) needs to be able to send funds. To enable that it needs to be removed from the blockedAddrs map.


This is how it was solved in interchain-security consumerApp:

    // Remove the fee-pool from the group of blocked recipient addresses in bank
    // this is required for the consumer chain to be able to send tokens to
    // the provider chain
    bankBlockedAddrs := app.ModuleAccountAddrs()
    delete(bankBlockedAddrs, authtypes.NewModuleAddress(
        ibcconsumertypes.ConsumerToSendToProviderName).String())

    app.BankKeeper = bankkeeper.NewBaseKeeper(
        appCodec,
        keys[banktypes.StoreKey],
        app.AccountKeeper,
        app.GetSubspace(banktypes.ModuleName),
        bankBlockedAddrs,
    )