Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use any as validator pubkey #7597

Merged
merged 58 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
e098384
protobuf pubkey type update
robert-zaremba Oct 19, 2020
4999b5c
wip2
robert-zaremba Oct 19, 2020
8f3645c
wip3
robert-zaremba Oct 19, 2020
bdd82af
solving types.NewValidator issues
robert-zaremba Oct 19, 2020
94047df
remove bech32 from validator type assignment
robert-zaremba Oct 19, 2020
324f31a
update Validator interface
robert-zaremba Oct 19, 2020
cc2d8a5
Changelog update
robert-zaremba Oct 19, 2020
774bf73
wip4
robert-zaremba Oct 19, 2020
ee2cad2
update genutil
robert-zaremba Oct 19, 2020
fc02eab
fix simapp & x/ibc/testing tests
clevinson Oct 19, 2020
51b2ab9
update staking
robert-zaremba Oct 19, 2020
05b8e73
changelog update
robert-zaremba Oct 19, 2020
3f139a1
fix import cycle in tests
robert-zaremba Oct 19, 2020
8734a4e
fix amino panic on TestValidatorMarshalUnmarshalJSON
robert-zaremba Oct 19, 2020
dfa92d6
fix TestValidatorMarshalUnmarshalJSON consensus_pubkey check
robert-zaremba Oct 19, 2020
32a2278
Add UnpackInterfaces to HistoricalInfo
robert-zaremba Oct 20, 2020
da990bf
fix TestHistoricalInfo
robert-zaremba Oct 20, 2020
003affd
update todos
robert-zaremba Oct 20, 2020
ff38afc
fix: Expecting ed25519.PubKey to implement proto.Message
robert-zaremba Oct 20, 2020
d50c77e
fix linter issues
robert-zaremba Oct 20, 2020
27ef9a7
Fix migrate test
amaury1093 Oct 20, 2020
4a95588
Update CHANGELOG.md
robert-zaremba Oct 20, 2020
98080ac
Merge pull request #7596 from cosmos/am-7477-migrate-staking
amaury1093 Oct 20, 2020
1dd1742
review comments
robert-zaremba Oct 20, 2020
515c072
cosmetic changes
robert-zaremba Oct 20, 2020
5cc8260
add UnpackInterfaces got GenesisRandomized test
robert-zaremba Oct 20, 2020
217bd2d
Validator.Equal reuses Validator.MinEqual
robert-zaremba Oct 20, 2020
605e33e
fix test
robert-zaremba Oct 20, 2020
d95c789
use Validator.Equal in tests
robert-zaremba Oct 20, 2020
5a07467
Fix staking simulation TestRandomizedGenState
blushi Oct 20, 2020
77f149f
Remove TODO
blushi Oct 20, 2020
1ac1245
use HistoricalInfo.Equal
robert-zaremba Oct 20, 2020
e6ac2ee
use proto.Equal
robert-zaremba Oct 20, 2020
da53a90
rename Validator.GetConsPubKey to TmConsPubKey
robert-zaremba Oct 20, 2020
978d9df
prefer require.Equal over reflect.DeepEqual
robert-zaremba Oct 20, 2020
653e4e4
SetHistoricalInfo using a pointer
robert-zaremba Oct 20, 2020
3da8daf
Fix TestQueryDelegation test
blushi Oct 21, 2020
34257ee
Fix TestQueryValidators test
blushi Oct 21, 2020
8905dfe
Fix TestSimulateMsgUnjail test
blushi Oct 21, 2020
fa73f01
experiement with LegacyAmino instances
robert-zaremba Oct 21, 2020
602928c
Register codecs in all simapp tests
robert-zaremba Oct 21, 2020
4774148
Fix cli_test compilation problems
robert-zaremba Oct 21, 2020
5350cc3
fix typo sdk -> std
robert-zaremba Oct 21, 2020
eddbe0c
fix typo
robert-zaremba Oct 21, 2020
62c1fc5
fix TestPlanStringer
robert-zaremba Oct 21, 2020
bfc93a3
Merge branch 'master' into robert/validator-pubkey
robert-zaremba Oct 21, 2020
a500f82
Rename to MakeEncodingConfig
amaury1093 Oct 22, 2020
6e33895
Remove RegisterCodecsTests
amaury1093 Oct 22, 2020
71e5331
Use gRPC in GetCmdQueryValidators
amaury1093 Oct 22, 2020
1cae118
Empty status
amaury1093 Oct 22, 2020
334253f
Merge pull request #7626 from cosmos/am-validator-pubkey
robert-zaremba Oct 22, 2020
54c85a5
fix info log check
robert-zaremba Oct 22, 2020
9d0ca25
linter fixes
robert-zaremba Oct 22, 2020
2598a7f
rename simapparams to simappparams
robert-zaremba Oct 23, 2020
4e21ba4
Update simapp/test_helpers.go
robert-zaremba Oct 23, 2020
a019c4d
comments updates
robert-zaremba Oct 23, 2020
1c8b045
use valAddr1 instead of sdk.ValAddress(pk1.Address().Bytes())
robert-zaremba Oct 23, 2020
1fa3829
Merge branch 'master' into robert/validator-pubkey
robert-zaremba Oct 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion baseapp/msg_service_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

func TestMsgService(t *testing.T) {
priv, _, _ := testdata.KeyTestPubAddr()
encCfg := simapp.MakeEncodingConfigTests()
encCfg := simapp.MakeEncodingConfig()
db := dbm.NewMemDB()
app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder())
app.SetInterfaceRegistry(encCfg.InterfaceRegistry)
Expand Down
2 changes: 1 addition & 1 deletion client/grpc/simulate/simulate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
app.BankKeeper.SetParams(sdkCtx, banktypes.DefaultParams())

// Set up TxConfig.
encodingConfig := simapp.MakeEncodingConfigTests()
encodingConfig := simapp.MakeEncodingConfig()
clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig)

// Create new simulation server.
Expand Down
13 changes: 0 additions & 13 deletions client/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)
return ctx.queryABCI(req)
}

// QuerySubspace performs a query to a Tendermint node with the provided
// store name and subspace. It returns key value pair and height of the query
// upon success or an error if the query fails.
func (ctx Context) QuerySubspace(subspace []byte, storeName string) (res []sdk.KVPair, height int64, err error) {
resRaw, height, err := ctx.queryStore(subspace, storeName, "subspace")
if err != nil {
return res, height, err
}

ctx.LegacyAmino.MustUnmarshalBinaryBare(resRaw, &res)
return
}

// GetFromAddress returns the from address from the context's name.
func (ctx Context) GetFromAddress() sdk.AccAddress {
return ctx.FromAddress
Expand Down
2 changes: 1 addition & 1 deletion client/tx/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type TestSuite struct {
}

func (s *TestSuite) SetupSuite() {
encCfg := simapp.MakeEncodingConfigTests()
encCfg := simapp.MakeEncodingConfig()
s.encCfg = encCfg
s.protoCfg = tx.NewTxConfig(codec.NewProtoCodec(encCfg.InterfaceRegistry), tx.DefaultSignModes)
s.aminoCfg = legacytx.StdTxConfig{Cdc: encCfg.Amino}
Expand Down
2 changes: 1 addition & 1 deletion client/tx/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func NewTestTxConfig() client.TxConfig {
cfg := simapp.MakeEncodingConfigTests()
cfg := simapp.MakeEncodingConfig()
return cfg.TxConfig
}

Expand Down
4 changes: 2 additions & 2 deletions server/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t

logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
db := dbm.NewMemDB()
encCfg := simapp.MakeEncodingConfigTests()
encCfg := simapp.MakeEncodingConfig()
app := simapp.NewSimApp(logger, db, nil, true, map[int64]bool{}, tempDir, 0, encCfg)

serverCtx := server.NewDefaultContext()
Expand All @@ -149,7 +149,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t

cmd := server.ExportCmd(
func(_ log.Logger, _ dbm.DB, _ io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string) (types.ExportedApp, error) {
encCfg := simapp.MakeEncodingConfigTests()
encCfg := simapp.MakeEncodingConfig()

var simApp *simapp.SimApp
if height != -1 {
Expand Down
2 changes: 1 addition & 1 deletion simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func NewSimApp(
// simapp. It is useful for tests and clients who do not want to construct the
// full simapp
func MakeCodecs() (codec.Marshaler, *codec.LegacyAmino) {
config := MakeEncodingConfigTests()
config := MakeEncodingConfig()
return config.Marshaler, config.Amino
}

Expand Down
6 changes: 3 additions & 3 deletions simapp/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func TestSimAppExport(t *testing.T) {
db := dbm.NewMemDB()
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfigTests())
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())

genesisState := NewDefaultGenesisState()
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
Expand All @@ -30,15 +30,15 @@ func TestSimAppExport(t *testing.T) {
app.Commit()

// Making a new app object with the db, so that initchain hasn't been called
app2 := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfigTests())
app2 := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())
_, err = app2.ExportAppStateAndValidators(false, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}

// ensure that blocked addresses are properly set in bank keeper
func TestBlockedAddrs(t *testing.T) {
db := dbm.NewMemDB()
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfigTests())
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())

for acc := range maccPerms {
require.Equal(t, !allowedReceivingModAcc[acc], app.BankKeeper.BlockedAddr(app.AccountKeeper.GetModuleAddress(acc)))
Expand Down
10 changes: 7 additions & 3 deletions simapp/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ package simapp

import (
simapparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/std"
)

// MakeEncodingConfigTests creates an EncodingConfig for testing
func MakeEncodingConfigTests() simapparams.EncodingConfig {
// MakeEncodingConfig creates an EncodingConfig for testing
func MakeEncodingConfig() simapparams.EncodingConfig {
robert-zaremba marked this conversation as resolved.
Show resolved Hide resolved
encodingConfig := simapparams.MakeEncodingConfig()
encodingConfig.RegisterCodecsTests(ModuleBasics)
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
}
2 changes: 1 addition & 1 deletion simapp/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ type GenesisState map[string]json.RawMessage

// NewDefaultGenesisState generates the default state for the application.
func NewDefaultGenesisState() GenesisState {
encCfg := MakeEncodingConfigTests()
encCfg := MakeEncodingConfig()
return ModuleBasics.DefaultGenesis(encCfg.Marshaler)
}
13 changes: 0 additions & 13 deletions simapp/params/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/types/module"
)

// EncodingConfig specifies the concrete encoding types to use for a given app.
Expand All @@ -16,14 +14,3 @@ type EncodingConfig struct {
TxConfig client.TxConfig
Amino *codec.LegacyAmino
}

// RegisterCodecsTests registars codecs from the config to the global and
// modules scope (mbm != nil).
func (ec *EncodingConfig) RegisterCodecsTests(mbm module.BasicManager) {
std.RegisterLegacyAminoCodec(ec.Amino)
std.RegisterInterfaces(ec.InterfaceRegistry)
if mbm != nil {
mbm.RegisterLegacyAminoCodec(ec.Amino)
mbm.RegisterInterfaces(ec.InterfaceRegistry)
}
}
8 changes: 4 additions & 4 deletions simapp/sim_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func BenchmarkFullAppSimulation(b *testing.B) {
}
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt())

// run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
Expand All @@ -39,7 +39,7 @@ func BenchmarkFullAppSimulation(b *testing.B) {
SimulationOperations(app, app.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
ModuleBasics,
app.AppCodec(),
)

// export state and simParams before the simulation error is checked
Expand Down Expand Up @@ -72,7 +72,7 @@ func BenchmarkInvariants(b *testing.B) {
}
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt())

// run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
Expand All @@ -84,7 +84,7 @@ func BenchmarkInvariants(b *testing.B) {
SimulationOperations(app, app.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
ModuleBasics,
app.AppCodec(),
)

// export state and simParams before the simulation error is checked
Expand Down
25 changes: 14 additions & 11 deletions simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestFullAppSimulation(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// run randomized simulation
Expand All @@ -81,7 +81,7 @@ func TestFullAppSimulation(t *testing.T) {
SimulationOperations(app, app.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
ModuleBasics,
app.AppCodec(),
)

// export state and simParams before the simulation error is checked
Expand All @@ -106,7 +106,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// Run randomized simulation
Expand All @@ -119,7 +119,8 @@ func TestAppImportExport(t *testing.T) {
SimulationOperations(app, app.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
ModuleBasics)
app.AppCodec(),
)

// export state and simParams before the simulation error is checked
err = CheckExportSimulation(app, config, simParams)
Expand All @@ -145,7 +146,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), fauxMerkleModeOpt)
newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", newApp.Name())

var genesisState GenesisState
Expand Down Expand Up @@ -202,7 +203,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// Run randomized simulation
Expand All @@ -215,7 +216,8 @@ func TestAppSimulationAfterImport(t *testing.T) {
SimulationOperations(app, app.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
ModuleBasics)
app.AppCodec(),
)

// export state and simParams before the simulation error is checked
err = CheckExportSimulation(app, config, simParams)
Expand Down Expand Up @@ -246,7 +248,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), fauxMerkleModeOpt)
newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", newApp.Name())

newApp.InitChain(abci.RequestInitChain{
Expand All @@ -262,7 +264,8 @@ func TestAppSimulationAfterImport(t *testing.T) {
SimulationOperations(newApp, newApp.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
ModuleBasics)
app.AppCodec(),
)
require.NoError(t, err)
}

Expand Down Expand Up @@ -296,7 +299,7 @@ func TestAppStateDeterminism(t *testing.T) {
}

db := dbm.NewMemDB()
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfigTests(), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt())

fmt.Printf(
"running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
Expand All @@ -312,7 +315,7 @@ func TestAppStateDeterminism(t *testing.T) {
SimulationOperations(app, app.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
ModuleBasics,
app.AppCodec(),
)
require.NoError(t, err)

Expand Down
6 changes: 3 additions & 3 deletions simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
// NewRootCmd creates a new root command for simd. It is called once in the
// main function.
func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
encodingConfig := simapp.MakeEncodingConfigTests()
encodingConfig := simapp.MakeEncodingConfig()
initClientCtx := client.Context{}.
WithJSONMarshaler(encodingConfig.Marshaler).
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
Expand Down Expand Up @@ -191,7 +191,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty
logger, db, traceStore, true, skipUpgradeHeights,
cast.ToString(appOpts.Get(flags.FlagHome)),
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
simapp.MakeEncodingConfigTests(), // Ideally, we would reuse the one created by NewRootCmd.
simapp.MakeEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd.
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
Expand All @@ -211,7 +211,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty
func createSimappAndExport(
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error) {
encCfg := simapp.MakeEncodingConfigTests() // Ideally, we would reuse the one created by NewRootCmd.
encCfg := simapp.MakeEncodingConfig() // Ideally, we would reuse the one created by NewRootCmd.
encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry)
var simApp *simapp.SimApp
if height != -1 {
Expand Down
6 changes: 3 additions & 3 deletions simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var DefaultConsensusParams = &abci.ConsensusParams{
// Setup initializes a new SimApp. A Nop logger is set in SimApp.
func Setup(isCheckTx bool) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfigTests())
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig())
if !isCheckTx {
// init chain must be called to stop deliverState from being nil
genesisState := NewDefaultGenesisState()
Expand Down Expand Up @@ -79,7 +79,7 @@ func Setup(isCheckTx bool) *SimApp {
// account. A Nop logger is set in SimApp.
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfigTests())
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig())

genesisState := NewDefaultGenesisState()

Expand Down Expand Up @@ -160,7 +160,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
// accounts and possible balances.
func SetupWithGenesisAccounts(genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfigTests())
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())

// initialize the chain with the passed in genesis accounts
genesisState := NewDefaultGenesisState()
Expand Down
2 changes: 1 addition & 1 deletion testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type Config struct {
// DefaultConfig returns a sane default configuration suitable for nearly all
// testing requirements.
func DefaultConfig() Config {
encCfg := simapp.MakeEncodingConfigTests()
encCfg := simapp.MakeEncodingConfig()

return Config{
Codec: encCfg.Marshaler,
Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) {
suite.ctx = suite.ctx.WithBlockHeight(1)

// Set up TxConfig.
encodingConfig := simapp.MakeEncodingConfigTests()
encodingConfig := simapp.MakeEncodingConfig()
// We're using TestMsg encoding in some tests, so register it here.
encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil)
testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry)
Expand Down
4 changes: 2 additions & 2 deletions x/auth/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ func (s *IntegrationTestSuite) TestGetAccountCmd() {

func TestGetBroadcastCommand_OfflineFlag(t *testing.T) {
clientCtx := client.Context{}.WithOffline(true)
clientCtx = clientCtx.WithTxConfig(simapp.MakeEncodingConfigTests().TxConfig)
clientCtx = clientCtx.WithTxConfig(simapp.MakeEncodingConfig().TxConfig)

cmd := authcli.GetBroadcastCommand()
_ = testutil.ApplyMockIODiscardOutErr(cmd)
Expand All @@ -767,7 +767,7 @@ func TestGetBroadcastCommand_OfflineFlag(t *testing.T) {

func TestGetBroadcastCommand_WithoutOfflineFlag(t *testing.T) {
clientCtx := client.Context{}
txCfg := simapp.MakeEncodingConfigTests().TxConfig
txCfg := simapp.MakeEncodingConfig().TxConfig
clientCtx = clientCtx.WithTxConfig(txCfg)

ctx := context.Background()
Expand Down
Loading