From 78add43514f7455ed9d0aa9014b4b5085b9fca43 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 18 Sep 2023 17:10:20 +0200 Subject: [PATCH] fix broken tests --- client/tx/aux_builder_test.go | 12 ------------ x/auth/migrations/legacytx/stdtx_test.go | 15 --------------- x/tx/signing/aminojson/aminojson_test.go | 13 ------------- 3 files changed, 40 deletions(-) diff --git a/client/tx/aux_builder_test.go b/client/tx/aux_builder_test.go index aa25b927826d..b78cea1c0c93 100644 --- a/client/tx/aux_builder_test.go +++ b/client/tx/aux_builder_test.go @@ -84,18 +84,6 @@ func TestAuxTxBuilder(t *testing.T) { }, true, "got unknown sign mode SIGN_MODE_UNSPECIFIED", }, - { - "GetSignBytes tipper should not be nil (if tip is set)", - func() error { - require.NoError(t, b.SetMsgs(msg1)) - require.NoError(t, b.SetPubKey(pub1)) - require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) - - _, err := b.GetSignBytes() - return err - }, - true, "tipper cannot be empty", - }, { "GetSignBytes works for DIRECT_AUX", func() error { diff --git a/x/auth/migrations/legacytx/stdtx_test.go b/x/auth/migrations/legacytx/stdtx_test.go index fd6bc84869d8..f49357ca6398 100644 --- a/x/auth/migrations/legacytx/stdtx_test.go +++ b/x/auth/migrations/legacytx/stdtx_test.go @@ -85,21 +85,6 @@ func TestStdSignBytes(t *testing.T) { args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, addr, msgStr), }, - { - "no fee, with tip", - args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, msgStr, addr), - }, - { - "with fee and with tip", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, addr, msgStr, addr), - }, - { - "with empty tip (but not nil), tipper cannot be empty", - args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[],"tipper":"%s"}}`, msgStr, addr), - }, } handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{ FileResolver: proto.HybridResolver, diff --git a/x/tx/signing/aminojson/aminojson_test.go b/x/tx/signing/aminojson/aminojson_test.go index 43bcf6f6d97f..36e003d35be4 100644 --- a/x/tx/signing/aminojson/aminojson_test.go +++ b/x/tx/signing/aminojson/aminojson_test.go @@ -57,13 +57,6 @@ func TestAminoJsonSignMode(t *testing.T) { return opts }, }, - { - name: "empty tipper", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - return opts - }, - error: "tipper cannot be empty", - }, { name: "nil fee", malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { @@ -72,12 +65,6 @@ func TestAminoJsonSignMode(t *testing.T) { }, error: "fee cannot be nil", }, - { - name: "tipper is signer", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - return opts - }, - }, } for _, tc := range testCases {