diff --git a/tests/systemtests/fraud_test.go b/tests/systemtests/fraud_test.go index a4c0b7875d8..2d2b8ae38cf 100644 --- a/tests/systemtests/fraud_test.go +++ b/tests/systemtests/fraud_test.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -43,8 +44,8 @@ func TestValidatorDoubleSign(t *testing.T) { // let's wait some blocks to have evidence and update persisted var nodePowerAfter int64 = -1 - for i := 0; i < 30; i++ { - systest.Sut.AwaitNextBlock(t) + for i := 0; i < 100; i++ { + systest.Sut.AwaitNextBlock(t, 6*time.Second) if nodePowerAfter = systest.QueryCometValidatorPower(rpc, pkBz); nodePowerAfter == 0 { break } diff --git a/tests/systemtests/upgrade_test.go b/tests/systemtests/upgrade_test.go index ae1e71903e9..81e2b93f5d6 100644 --- a/tests/systemtests/upgrade_test.go +++ b/tests/systemtests/upgrade_test.go @@ -40,7 +40,7 @@ func TestChainUpgrade(t *testing.T) { upgradeName = "v052-to-v054" // must match UpgradeName in simapp/upgrades.go ) - systest.Sut.StartChain(t, fmt.Sprintf("--halt-height=%d", upgradeHeight+1)) + systest.Sut.StartChain(t, fmt.Sprintf("--comet.halt-height=%d", upgradeHeight+1)) cli := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose) govAddr := sdk.AccAddress(address.Module("gov")).String() diff --git a/x/auth/tx/config.go b/x/auth/tx/config.go index 9b10f645a62..42a0760d978 100644 --- a/x/auth/tx/config.go +++ b/x/auth/tx/config.go @@ -189,16 +189,15 @@ func NewTxConfigWithOptions(protoCodec codec.Codec, configOptions ConfigOptions) } } + txConfig.txDecoder, err = txdecode.NewDecoder(txdecode.Options{ + SigningContext: configOptions.SigningContext, + ProtoCodec: protoCodec, + }) + if err != nil { + return nil, err + } if configOptions.ProtoDecoder == nil { - dec, err := txdecode.NewDecoder(txdecode.Options{ - SigningContext: configOptions.SigningContext, - ProtoCodec: protoCodec, - }) - if err != nil { - return nil, err - } - txConfig.decoder = txV2toInterface(configOptions.SigningOptions.AddressCodec, protoCodec, dec) - txConfig.txDecoder = dec + txConfig.decoder = DefaultTxDecoder(configOptions.SigningOptions.AddressCodec, protoCodec, txConfig.txDecoder) } if configOptions.ProtoEncoder == nil { txConfig.encoder = DefaultTxEncoder() @@ -262,13 +261,3 @@ func (g config) TxJSONDecoder() sdk.TxDecoder { func (g config) SigningContext() *txsigning.Context { return g.signingContext } - -func txV2toInterface(addrCodec address.Codec, cdc codec.BinaryCodec, decoder *txdecode.Decoder) func([]byte) (sdk.Tx, error) { - return func(txBytes []byte) (sdk.Tx, error) { - decodedTx, err := decoder.Decode(txBytes) - if err != nil { - return nil, err - } - return newWrapperFromDecodedTx(addrCodec, cdc, decodedTx) - } -} diff --git a/x/auth/tx/decoder.go b/x/auth/tx/decoder.go index 74b20621690..93474a6bb5b 100644 --- a/x/auth/tx/decoder.go +++ b/x/auth/tx/decoder.go @@ -14,6 +14,17 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx" ) +// DefaultTxDecoder returns a default protobuf TxDecoder. +func DefaultTxDecoder(addrCodec address.Codec, cdc codec.BinaryCodec, decoder *decode.Decoder) func([]byte) (sdk.Tx, error) { + return func(txBytes []byte) (sdk.Tx, error) { + decodedTx, err := decoder.Decode(txBytes) + if err != nil { + return nil, err + } + return newWrapperFromDecodedTx(addrCodec, cdc, decodedTx) + } +} + // DefaultJSONTxDecoder returns a default protobuf JSON TxDecoder using the provided Marshaler. func DefaultJSONTxDecoder(addrCodec address.Codec, cdc codec.Codec, decoder *decode.Decoder) sdk.TxDecoder { return func(txBytes []byte) (sdk.Tx, error) {