Skip to content

Commit

Permalink
use refactored kvindexer (#26)
Browse files Browse the repository at this point in the history
* use refactored kvindexer

* bump kvindexer
  • Loading branch information
Vritra4 authored Apr 25, 2024
1 parent c0edfb5 commit b55b4bc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 22 deletions.
44 changes: 25 additions & 19 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ import (
// kvindexer
indexer "github.com/initia-labs/kvindexer"
indexerconfig "github.com/initia-labs/kvindexer/config"
indexermodule "github.com/initia-labs/kvindexer/module"
indexerkeeper "github.com/initia-labs/kvindexer/module/keeper"
blocksubmodule "github.com/initia-labs/kvindexer/submodule/block"
"github.com/initia-labs/kvindexer/submodule/nft"
"github.com/initia-labs/kvindexer/submodule/pair"
"github.com/initia-labs/kvindexer/submodule/tx"
blocksubmodule "github.com/initia-labs/kvindexer/submodules/block"
nft "github.com/initia-labs/kvindexer/submodules/move-nft"
pair "github.com/initia-labs/kvindexer/submodules/pair"
tx "github.com/initia-labs/kvindexer/submodules/tx"
indexermodule "github.com/initia-labs/kvindexer/x/kvindexer"
indexerkeeper "github.com/initia-labs/kvindexer/x/kvindexer/keeper"

// unnamed import of statik for swagger UI support
_ "github.com/initia-labs/minimove/client/docs/statik"
Expand Down Expand Up @@ -1232,24 +1232,30 @@ func (app *MinitiaApp) setupIndexer(appOpts servertypes.AppOptions, homePath str
}
app.indexerKeeper = indexerkeeper.NewKeeper(
appCodec,
app.AccountKeeper,
app.BankKeeper,
nil, // placeholder for distribution keeper
nil, // placeholder for staking keeper
nil, // placeholder for reward keeper,
nil, // placeholder for community pool keeper
indexerkeeper.VMKeeper{Keeper: app.MoveKeeper}, // placeholder for wrapped vm keeper
app.IBCKeeper,
app.TransferKeeper,
app.NftTransferKeeper,
app.OPChildKeeper,
authtypes.FeeCollectorName,
"move",
homePath,
indexerConfig,
ac,
vc,
)
err = app.indexerKeeper.RegisterSubmodules(nft.Submodule, pair.Submodule, tx.Submodule, blocksubmodule.Submodule)

smBlock, err := blocksubmodule.NewBlockSubmodule(appCodec, app.indexerKeeper, app.OPChildKeeper)
if err != nil {
panic(err)
}
smTx, err := tx.NewTxSubmodule(appCodec, app.indexerKeeper)
if err != nil {
panic(err)
}
smPair, err := pair.NewPairSubmodule(appCodec, app.indexerKeeper, app.IBCKeeper.ChannelKeeper, app.TransferKeeper)
if err != nil {
panic(err)
}
smNft, err := nft.NewMoveNftSubmodule(ac, appCodec, app.indexerKeeper, app.MoveKeeper, smPair)
if err != nil {
panic(err)
}
err = app.indexerKeeper.RegisterSubmodules(smBlock, smTx, smPair, smNft)
if err != nil {
panic(err)
}
Expand Down
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ require (
github.com/gorilla/mux v1.8.1
github.com/initia-labs/OPinit v0.2.5
github.com/initia-labs/initia v0.2.5
github.com/initia-labs/kvindexer v0.0.0-20240419060315-a1d97e68ce38
github.com/initia-labs/kvindexer v0.1.0
github.com/initia-labs/kvindexer/submodules/block v0.1.0
github.com/initia-labs/kvindexer/submodules/move-nft v0.1.0
github.com/initia-labs/kvindexer/submodules/pair v0.1.0
github.com/initia-labs/kvindexer/submodules/tx v0.1.0
// we also need to update `LIBMOVEVM_VERSION` of images/private/Dockerfile#5
github.com/initia-labs/movevm v0.2.6
github.com/noble-assets/forwarding v0.0.0-20240416085758-ed8e9efaf69a
Expand Down
12 changes: 10 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,16 @@ github.com/initia-labs/ibc-go/v8 v8.0.0-20240419124350-4275a05abe2c h1:FDwh5zZbm
github.com/initia-labs/ibc-go/v8 v8.0.0-20240419124350-4275a05abe2c/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8=
github.com/initia-labs/initia v0.2.5 h1:s6kucRzWtWiKghlNE3djVzAcLBH5IdaHgoGNHsE5QVo=
github.com/initia-labs/initia v0.2.5/go.mod h1:ASbSwDv+qXwJo6HUiiUTsuf8F6xZ9RaHMyYQfJsXJkA=
github.com/initia-labs/kvindexer v0.0.0-20240419060315-a1d97e68ce38 h1:3NBkDgRm07XhiPX/D3yX7zDbAjwlq+WYplfX/a4LTxc=
github.com/initia-labs/kvindexer v0.0.0-20240419060315-a1d97e68ce38/go.mod h1:NpgGtWQ6w5LWLcD3NnfjBtmdWXYkQnUef5GOtpbQekc=
github.com/initia-labs/kvindexer v0.1.0 h1:AwBWy76fZrwj+et1LMlcwvDQZyxuQ1IdBgx4R+94hiU=
github.com/initia-labs/kvindexer v0.1.0/go.mod h1:+2hInhMys7TFlGsAey2bFH4tA9fu+5/W17Ttecf1NHc=
github.com/initia-labs/kvindexer/submodules/block v0.1.0 h1:y+EXnksd/I2F96mzIoQA64nZUZON2P+99YrSzeLCLoY=
github.com/initia-labs/kvindexer/submodules/block v0.1.0/go.mod h1:4c+c59wVAnjuaJv/pcDYaUkeVmOqVV+orqEjya/RIjo=
github.com/initia-labs/kvindexer/submodules/move-nft v0.1.0 h1:uhLJsUFTJF8+E4p3DkIjMxlrjQNPdPepb8Z6HSeONKI=
github.com/initia-labs/kvindexer/submodules/move-nft v0.1.0/go.mod h1:E75HJBUPG2y3gBGQ45ot9NgPbSRf6yMhtMwXp2SuAuE=
github.com/initia-labs/kvindexer/submodules/pair v0.1.0 h1:mZeeYhhz78J/LKjrVGzV9ervjDoBV4AoeiFRBZN+0CI=
github.com/initia-labs/kvindexer/submodules/pair v0.1.0/go.mod h1:VzSXi4eW2dCJ/B1okO6jGIKOhaPurM/PkWWS5OdFgSE=
github.com/initia-labs/kvindexer/submodules/tx v0.1.0 h1:6kbf6wmzXPN0XCQLasiFgq1AlZHkt5K3/ZG+IWw1nNs=
github.com/initia-labs/kvindexer/submodules/tx v0.1.0/go.mod h1:i0XeLbLa6xdgTR01WF8kaAO50vMmwxbeq0fKexwpFHU=
github.com/initia-labs/movevm v0.2.6 h1:dhXGeS4cwCA+bnOPv6xWfDX0LdVD+7O5ZV/8+GeQqmM=
github.com/initia-labs/movevm v0.2.6/go.mod h1:6MxR4GP5zH3JUc1IMgfqAe1e483mZVS7fshPknZPJ30=
github.com/initia-labs/slinky v0.0.0-20240418051646-d45167cc66b1 h1:7mXLhI/X+GLdAYNmzXE5CIvTuOgETUMB7tR6VHvX/tY=
Expand Down

0 comments on commit b55b4bc

Please sign in to comment.