refactor: move nebula configuration to static file

This commit is contained in:
Prad Nukala
2024-09-30 21:51:16 -04:00
parent 37585b4df2
commit 48b197890e
18 changed files with 186 additions and 107 deletions
+6 -8
View File
@@ -3,18 +3,16 @@ package module
import (
"os"
"github.com/cosmos/cosmos-sdk/codec"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/codec"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
modulev1 "github.com/onsonr/sonr/api/vault/module/v1"
didkeeper "github.com/onsonr/sonr/x/did/keeper"
@@ -59,7 +57,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.DidKeeper)
m := NewAppModule(in.Cdc, k)
m := NewAppModule(in.Cdc, k, in.DidKeeper)
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
}
+4 -7
View File
@@ -3,12 +3,9 @@ package keeper_test
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"cosmossdk.io/core/store"
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
@@ -23,8 +20,8 @@ import (
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"cosmossdk.io/core/store"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
didkeeper "github.com/onsonr/sonr/x/did/keeper"
module "github.com/onsonr/sonr/x/vault"
@@ -84,7 +81,7 @@ func SetupTest(t *testing.T) *testFixture {
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.didk)
f.msgServer = keeper.NewMsgServerImpl(f.k)
f.queryServer = keeper.NewQuerier(f.k)
f.appModule = module.NewAppModule(encCfg.Codec, f.k)
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didk)
return f
}
+4 -8
View File
@@ -4,25 +4,20 @@ import (
"context"
"encoding/json"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
abci "github.com/cometbft/cometbft/abci/types"
"cosmossdk.io/client/v2/autocli"
errorsmod "cosmossdk.io/errors"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
didkeeper "github.com/onsonr/sonr/x/did/keeper"
"github.com/onsonr/sonr/x/vault/keeper"
"github.com/onsonr/sonr/x/vault/types"
// this line is used by starport scaffolding # 1
)
const (
@@ -56,6 +51,7 @@ type AppModule struct {
func NewAppModule(
cdc codec.Codec,
keeper keeper.Keeper,
didkeeper didkeeper.Keeper,
) *AppModule {
return &AppModule{
AppModuleBasic: AppModuleBasic{cdc: cdc},