Skip to content

Commit

Permalink
fix: fix the e2e tests setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Jul 4, 2024
1 parent d3dd26a commit 01019e4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
7 changes: 3 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ type UmeeApp struct {
ScopedWasmKeeper capabilitykeeper.ScopedKeeper

// the module manager
mm *module.Manager
bmm module.BasicManager
mm *module.Manager

// simulation manager
sm *module.SimulationManager
Expand Down Expand Up @@ -1074,7 +1073,7 @@ func (app *UmeeApp) InterfaceRegistry() types.InterfaceRegistry {

// DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (app *UmeeApp) DefaultGenesis() map[string]json.RawMessage {
return app.bmm.DefaultGenesis(app.appCodec)
return ModuleBasics.DefaultGenesis(app.appCodec)
}

// GetKey returns the KVStoreKey for the provided store key.
Expand Down Expand Up @@ -1125,7 +1124,7 @@ func (app *UmeeApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo
nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register grpc-gateway routes for all modules.
app.bmm.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// register swagger API from root so that other applications can override easily
if apiConfig.Swagger {
Expand Down
10 changes: 5 additions & 5 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ func MakeEncodingConfig() mtestuti.TestEncodingConfig {
interfaceRegistry := testutil.CodecOptions{
AccAddressPrefix: params.AccountAddressPrefix,
ValAddressPrefix: params.ValidatorAddressPrefix,
}.NewInterfaceRegistry()
}

appCodec := codec.NewProtoCodec(interfaceRegistry)
appCodec := interfaceRegistry.NewCodec()
aminoCodec := codec.NewLegacyAmino()

// cosmos-sdk module
std.RegisterLegacyAminoCodec(aminoCodec)
std.RegisterInterfaces(interfaceRegistry)
std.RegisterInterfaces(appCodec.InterfaceRegistry())

// umee app modules
ModuleBasics.RegisterLegacyAminoCodec(aminoCodec)
ModuleBasics.RegisterInterfaces(interfaceRegistry)
ModuleBasics.RegisterInterfaces(appCodec.InterfaceRegistry())

encCfg := mtestuti.TestEncodingConfig{
InterfaceRegistry: interfaceRegistry,
InterfaceRegistry: appCodec.InterfaceRegistry(),
Codec: appCodec,
TxConfig: tx.NewTxConfig(appCodec, tx.DefaultSignModes),
Amino: aminoCodec,
Expand Down
6 changes: 4 additions & 2 deletions tests/e2e/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"
"time"

"cosmossdk.io/log"
sdkmath "cosmossdk.io/math"
tmconfig "github.com/cometbft/cometbft/config"
tmjson "github.com/cometbft/cometbft/libs/json"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (s *E2ETestSuite) SetupSuite() {

db := dbm.NewMemDB()
app := app.New(
nil,
log.NewNopLogger(),
db,
nil,
true,
Expand Down Expand Up @@ -332,7 +333,8 @@ func (s *E2ETestSuite) initGenesis() {
// write the updated genesis file to each validator
s.T().Log("writing updated genesis file to each validator")
for _, val := range s.Chain.Validators {
writeFile(filepath.Join(val.configDir(), "config", "genesis.json"), bz)
err = writeFile(filepath.Join(val.configDir(), "config", "genesis.json"), bz)
s.Require().NoError(err)
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/e2e/setup/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ func (v *validator) signMsg(cdc codec.Codec, msgs ...sdk.Msg) (*sdktx.Tx, error)
if err != nil {
return nil, err
}
signerData.PubKey = pubKey
sig := signing.SignatureV2{
PubKey: pubKey,
Data: &signing.SingleSignatureData{
Expand Down

0 comments on commit 01019e4

Please sign in to comment.