Skip to content

Commit

Permalink
fix StdTx registration
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Sep 15, 2020
1 parent 3352c56 commit e1b631e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions client/tx/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/types"
signing2 "github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
types3 "github.com/cosmos/cosmos-sdk/x/auth/types"
types2 "github.com/cosmos/cosmos-sdk/x/bank/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)

const (
Expand All @@ -30,7 +30,7 @@ var (
fee = types.NewCoins(types.NewInt64Coin("bam", 100))
_, pub1, addr1 = testdata.KeyTestPubAddr()
_, _, addr2 = testdata.KeyTestPubAddr()
msg = types2.NewMsgSend(addr1, addr2, types.NewCoins(types.NewInt64Coin("wack", 10000)))
msg = banktypes.NewMsgSend(addr1, addr2, types.NewCoins(types.NewInt64Coin("wack", 10000)))
sig = signing2.SignatureV2{
PubKey: pub1,
Data: &signing2.SingleSignatureData{
Expand Down Expand Up @@ -61,7 +61,7 @@ func (s *TestSuite) SetupSuite() {
encCfg := simapp.MakeEncodingConfig()
s.encCfg = encCfg
s.protoCfg = tx.NewTxConfig(codec.NewProtoCodec(encCfg.InterfaceRegistry), std.DefaultPublicKeyCodec{}, tx.DefaultSignModes)
s.aminoCfg = types3.StdTxConfig{Cdc: encCfg.Amino}
s.aminoCfg = legacytx.StdTxConfig{Cdc: encCfg.Amino}
}

func (s *TestSuite) TestCopyTx() {
Expand Down Expand Up @@ -112,7 +112,7 @@ func (s *TestSuite) TestConvertTxToStdTx() {
// std tx
aminoBuilder := s.aminoCfg.NewTxBuilder()
buildTestTx(s.T(), aminoBuilder)
stdTx = aminoBuilder.GetTx().(types3.StdTx)
stdTx = aminoBuilder.GetTx().(legacytx.StdTx)
stdTx2, err := tx2.ConvertTxToStdTx(s.encCfg.Amino, stdTx)
s.Require().NoError(err)
s.Require().Equal(stdTx, stdTx2)
Expand All @@ -122,7 +122,7 @@ func (s *TestSuite) TestConvertAndEncodeStdTx() {
// convert amino -> proto -> amino
aminoBuilder := s.aminoCfg.NewTxBuilder()
buildTestTx(s.T(), aminoBuilder)
stdTx := aminoBuilder.GetTx().(types3.StdTx)
stdTx := aminoBuilder.GetTx().(legacytx.StdTx)
txBz, err := tx2.ConvertAndEncodeStdTx(s.protoCfg, stdTx)
s.Require().NoError(err)
decodedTx, err := s.protoCfg.TxDecoder()(txBz)
Expand Down
1 change: 0 additions & 1 deletion x/auth/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterInterface((*AccountI)(nil), nil)
cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/BaseAccount", nil)
cdc.RegisterConcrete(&ModuleAccount{}, "cosmos-sdk/ModuleAccount", nil)
cdc.RegisterConcrete(legacytx.StdTx{}, "cosmos-sdk/StdTx", nil)

legacytx.RegisterLegacyAminoCodec(cdc)
}
Expand Down

0 comments on commit e1b631e

Please sign in to comment.