Skip to content

Commit

Permalink
fix: using cosmos sdk logs and fix token factory module
Browse files Browse the repository at this point in the history
  • Loading branch information
expertdicer committed Feb 20, 2025
1 parent 89f6ec9 commit aa7fb56
Show file tree
Hide file tree
Showing 38 changed files with 52 additions and 386 deletions.
2 changes: 1 addition & 1 deletion cmd/nibid/cmd/decode_base64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/NibiruChain/nibiru/app"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/server"
genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nibid/cmd/genaccounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/NibiruChain/nibiru/app"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nibid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/NibiruChain/nibiru/app/appconst"
"github.com/NibiruChain/nibiru/x/sudo/cli"

"cosmossdk.io/log"
dbm "github.com/cometbft/cometbft-db"
tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/client/debug"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nibid/cmd/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/NibiruChain/nibiru/app"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server"
Expand Down
2 changes: 1 addition & 1 deletion eth/indexer/kv_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"

errorsmod "cosmossdk.io/errors"
"cosmossdk.io/log"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down
2 changes: 1 addition & 1 deletion eth/indexer/kv_indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"math/big"
"testing"

tmlog "cosmossdk.io/log"
"cosmossdk.io/simapp/params"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
tmlog "github.com/cometbft/cometbft/libs/log"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/ethereum/go-ethereum/common"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"math/big"
"time"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
tmrpctypes "github.com/cometbft/cometbft/rpc/core/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/backend/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion eth/rpc/backend/tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package backend
import (
"fmt"

tmlog "cosmossdk.io/log"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
tmlog "github.com/cometbft/cometbft/libs/log"
tmrpctypes "github.com/cometbft/cometbft/rpc/core/types"
"github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/crypto"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/backend/tx_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"
"math/big"

tmlog "cosmossdk.io/log"
"cosmossdk.io/math"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
tmlog "github.com/cometbft/cometbft/libs/log"
tmrpctypes "github.com/cometbft/cometbft/rpc/core/types"
"github.com/cometbft/cometbft/types"
"github.com/ethereum/go-ethereum/common"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/backend/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/ethereum/go-ethereum/consensus/misc"
gethcore "github.com/ethereum/go-ethereum/core/types"

"cosmossdk.io/log"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmrpctypes "github.com/cometbft/cometbft/rpc/core/types"

"github.com/cometbft/cometbft/api/cometbft/crypto/v1"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/debugapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/cosmos/cosmos-sdk/server"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/consensus/ethash"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/debugapi/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"runtime/pprof"
"strings"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/server"
)

Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/eth_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

gethrpc "github.com/ethereum/go-ethereum/rpc"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/filtersapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/NibiruChain/nibiru/eth/rpc"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"

coretypes "github.com/cometbft/cometbft/rpc/core/types"
rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/filtersapi/filter_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/pkg/errors"

"cosmossdk.io/log"
tmjson "github.com/cometbft/cometbft/libs/json"
"github.com/cometbft/cometbft/libs/log"
tmquery "github.com/cometbft/cometbft/libs/pubsub/query"
coretypes "github.com/cometbft/cometbft/rpc/core/types"
rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/filtersapi/filter_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
coretypes "github.com/cometbft/cometbft/rpc/core/types"
"github.com/ethereum/go-ethereum/common"
gethcore "github.com/ethereum/go-ethereum/core/types"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/filtersapi/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/NibiruChain/nibiru/eth/rpc"
"github.com/NibiruChain/nibiru/eth/rpc/backend"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
tmrpctypes "github.com/cometbft/cometbft/rpc/core/types"
"github.com/pkg/errors"

Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/miner_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
)

// MinerAPI is the private miner prefixed set of APIs in the Miner JSON-RPC spec.
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/personal_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/NibiruChain/nibiru/eth"
"github.com/NibiruChain/nibiru/eth/crypto/hd"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"

"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/txpool_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package rpcapi

import (
"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"

"github.com/ethereum/go-ethereum/common/hexutil"

Expand Down
2 changes: 1 addition & 1 deletion eth/rpc/rpcapi/websockets.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/ethereum/go-ethereum/params"
gethrpc "github.com/ethereum/go-ethereum/rpc"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client"
tmtypes "github.com/cometbft/cometbft/types"

Expand Down
2 changes: 1 addition & 1 deletion simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"strings"
"testing"

"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
evidencetypes "cosmossdk.io/x/evidence/types"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down
2 changes: 1 addition & 1 deletion x/common/testutil/cli/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

serverconfig "github.com/NibiruChain/nibiru/app/server/config"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/testutil/sims"

"cosmossdk.io/math"
Expand Down
2 changes: 1 addition & 1 deletion x/common/testutil/client_ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down
2 changes: 1 addition & 1 deletion x/common/testutil/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"cosmossdk.io/log"
tmdb "github.com/cometbft/cometbft-db"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/types"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down
2 changes: 1 addition & 1 deletion x/common/testutil/testapp/testapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"encoding/json"
"time"

"cosmossdk.io/log"
"cosmossdk.io/math"
tmdb "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/testutil/sims"
Expand Down
2 changes: 1 addition & 1 deletion x/devgas/v1/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"

storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down
2 changes: 1 addition & 1 deletion x/evm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
gethparams "github.com/ethereum/go-ethereum/params"

sdkerrors "cosmossdk.io/errors"
"cosmossdk.io/log"
"cosmossdk.io/math"
"github.com/cometbft/cometbft/libs/log"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion x/inflation/keeper/keeper.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package keeper

import (
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
"github.com/NibiruChain/collections"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
storetypes "cosmossdk.io/store/types"

sdkerrors "cosmossdk.io/errors"
"cosmossdk.io/log"
"cosmossdk.io/math"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/keeper/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"
"time"

"cosmossdk.io/log"
"cosmossdk.io/math"
"cosmossdk.io/store"
storetypes "cosmossdk.io/store/types"
Expand All @@ -16,7 +17,6 @@ import (
dbm "github.com/cometbft/cometbft-db"
"github.com/cometbft/cometbft/crypto"
"github.com/cometbft/cometbft/crypto/secp256k1"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keeper
import (
"fmt"

"github.com/cometbft/cometbft/libs/log"
"cosmossdk.io/log"

storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down
21 changes: 15 additions & 6 deletions x/tokenfactory/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"encoding/json"
"fmt"

"cosmossdk.io/core/appmodule"
abci "github.com/cometbft/cometbft/abci/types"
sdkclient "github.com/cosmos/cosmos-sdk/client"
sdkcodec "github.com/cosmos/cosmos-sdk/codec"
Expand All @@ -36,8 +37,9 @@ var (
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModule = AppModule{}
_ module.AppModuleSimulation = AppModule{}
_ module.BeginBlockAppModule = AppModule{}
_ module.EndBlockAppModule = AppModule{}

_ appmodule.HasBeginBlocker = (*AppModule)(nil)
_ appmodule.HasEndBlocker = (*AppModule)(nil)
)

// ConsensusVersion defines the current module consensus version.
Expand Down Expand Up @@ -142,6 +144,12 @@ func (am AppModule) QuerierRoute() string {
return types.RouterKey
}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) IsOnePerModuleType() {}

// IsAppModule implements the appmodule.AppModule interface.
func (AppModule) IsAppModule() {}

// RegisterServices registers a GRPC query service to respond to the
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
Expand All @@ -152,13 +160,14 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
}

// BeginBlock executes all ABCI BeginBlock logic respective to the fees module.
func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
func (am AppModule) BeginBlock(_ context.Context) error {
return nil
}

// EndBlock executes all ABCI EndBlock logic respective to the fee-share module. It
// returns no validator updates.
func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
func (am AppModule) EndBlock(_ context.Context) error {
return nil
}

// InitGenesis performs the fees module's genesis initialization. It returns
Expand All @@ -183,7 +192,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) {
}

// RegisterStoreDecoder implements module.AppModuleSimulation.
func (AppModule) RegisterStoreDecoder(sdk.StoreDecoderRegistry) {
func (AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) {
}

// WeightedOperations implements module.AppModuleSimulation.
Expand Down
Loading

0 comments on commit aa7fb56

Please sign in to comment.