Skip to content

Commit

Permalink
feat: load bitcoin indexer module
Browse files Browse the repository at this point in the history
  • Loading branch information
oxf71 committed Nov 14, 2023
1 parent 1087db7 commit 190906a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ import (
"github.com/evmos/ethermint/ethereum/eip712"
srvflags "github.com/evmos/ethermint/server/flags"
ethermint "github.com/evmos/ethermint/types"
"github.com/evmos/ethermint/x/bitcoinindexer"
bitcoinindexerkeeper "github.com/evmos/ethermint/x/bitcoinindexer/keeper"
bitcoinindexertypes "github.com/evmos/ethermint/x/bitcoinindexer/types"
"github.com/evmos/ethermint/x/evm"
evmkeeper "github.com/evmos/ethermint/x/evm/keeper"
evmtypes "github.com/evmos/ethermint/x/evm/types"
Expand Down Expand Up @@ -178,6 +181,8 @@ var (
// Ethermint modules
evm.AppModuleBasic{},
feemarket.AppModuleBasic{},
// bitcoin modules
bitcoinindexer.AppModuleBasic{},
)

// module account permissions
Expand All @@ -190,6 +195,7 @@ var (
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
evmtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, // used for secure addition and subtraction of balance using module account
// bitcoinindexertypes.ModuleName: nil, // bitcoinindexer permission is undetermined
}

// module accounts that are allowed to receive tokens
Expand Down Expand Up @@ -242,6 +248,9 @@ type EthermintApp struct {
EvmKeeper *evmkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper

// Bitcoin keepers
BitcoinindexerKeeper bitcoinindexerkeeper.Keeper

// the module manager
mm *module.Manager

Expand Down Expand Up @@ -291,6 +300,8 @@ func NewEthermintApp(
ibchost.StoreKey, ibctransfertypes.StoreKey,
// ethermint keys
evmtypes.StoreKey, feemarkettypes.StoreKey,
// bitcoin keys
bitcoinindexertypes.StoreKey,
)

// Add the EVM transient store key
Expand Down Expand Up @@ -473,6 +484,16 @@ func NewEthermintApp(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

// Create bitcoinindexer keeper
app.BitcoinindexerKeeper = *bitcoinindexerkeeper.NewKeeper(
appCodec,
keys[bitcoinindexertypes.StoreKey],
keys[bitcoinindexertypes.MemStoreKey],
app.GetSubspace(bitcoinindexertypes.ModuleName),
)
// TODO: NewAppModule remove account bank params
// bitcoinindexer := bitcoinindexer.NewAppModule(appCodec, app.BitcoinindexerKeeper, app.AccountKeeper, app.BankKeeper)

/**** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
Expand Down

0 comments on commit 190906a

Please sign in to comment.