Skip to content

Commit

Permalink
add error handling for indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Aug 2, 2024
1 parent 6c515ae commit ef932ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ func NewMinitiaApp(
app.SetEndBlocker(app.EndBlocker)

// setup BlockSDK

mempool, anteHandler, checkTx, prepareProposalHandler, processProposalHandler, err := setupBlockSDK(app, mempoolMaxTxs)
if err != nil {
tmos.Exit(err.Error())

Check warning on line 292 in app/app.go

View check run for this annotation

Codecov / codecov/patch

app/app.go#L292

Added line #L292 was not covered by tests
Expand Down
4 changes: 3 additions & 1 deletion app/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ func setupIndexer(
// Add your implementation here

kvIndexer, err := kvindexer.NewIndexer(app.GetBaseApp().Logger(), kvIndexerKeeper)
if err != nil || kvIndexer == nil {
if err != nil {
return nil, nil, nil, err

Check warning on line 64 in app/indexer.go

View check run for this annotation

Codecov / codecov/patch

app/indexer.go#L64

Added line #L64 was not covered by tests
} else if kvIndexer == nil {
return nil, nil, nil, nil
}

Expand Down
9 changes: 7 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package keepers

import (
// cosmos mod imports
storetypes "cosmossdk.io/store/types"
"cosmossdk.io/x/feegrant"
upgradetypes "cosmossdk.io/x/upgrade/types"

// cosmos imports
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand All @@ -13,6 +15,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/group"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"

// ibc imports
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types"
ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types"
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
Expand All @@ -21,22 +24,24 @@ import (
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"

// initia ibc imports
ibchookstypes "github.com/initia-labs/initia/x/ibc-hooks/types"
ibcnfttransfertypes "github.com/initia-labs/initia/x/ibc/nft-transfer/types"
icaauthtypes "github.com/initia-labs/initia/x/intertx/types"

// initia imports
movetypes "github.com/initia-labs/initia/x/move/types"

// OPinit imports
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"

// skip imports
auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"

// noble forwarding keeper

forwardingtypes "github.com/noble-assets/forwarding/v2/x/forwarding/types"
// kvindexer
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand Down

0 comments on commit ef932ff

Please sign in to comment.