Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
facundomedica committed Feb 20, 2024
1 parent fb47eac commit 4c0d6c7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
36 changes: 21 additions & 15 deletions baseapp/abci_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,15 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSe
testTxs[i].size = int(cmttypes.ComputeProtoSizeForTxs([]cmttypes.Tx{bz}))
}

s.Require().Equal(testTxs[0].size, 111)
s.Require().Equal(testTxs[1].size, 121)
s.Require().Equal(testTxs[2].size, 112)
s.Require().Equal(testTxs[3].size, 112)
s.Require().Equal(testTxs[4].size, 195)
s.Require().Equal(testTxs[5].size, 205)
s.Require().Equal(testTxs[6].size, 196)
s.Require().Equal(testTxs[7].size, 196)
s.Require().Equal(testTxs[8].size, 196)
s.Require().Equal(180, testTxs[0].size)
s.Require().Equal(190, testTxs[1].size)
s.Require().Equal(181, testTxs[2].size)
s.Require().Equal(181, testTxs[3].size)
s.Require().Equal(263, testTxs[4].size)
s.Require().Equal(273, testTxs[5].size)
s.Require().Equal(264, testTxs[6].size)
s.Require().Equal(264, testTxs[7].size)
s.Require().Equal(264, testTxs[8].size)

testCases := map[string]struct {
ctx sdk.Context
Expand All @@ -490,15 +490,15 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSe
ctx: s.ctx,
txInputs: []testTx{testTxs[0], testTxs[1], testTxs[2], testTxs[3]},
req: &abci.RequestPrepareProposal{
MaxTxBytes: 111 + 112,
MaxTxBytes: 180 + 181,
},
expectedTxs: []int{0, 3},
},
"skip multi-signers msg non-sequential sequence": {
ctx: s.ctx,
txInputs: []testTx{testTxs[4], testTxs[5], testTxs[6], testTxs[7], testTxs[8]},
req: &abci.RequestPrepareProposal{
MaxTxBytes: 195 + 196,
MaxTxBytes: 263 + 264,
},
expectedTxs: []int{4, 8},
},
Expand All @@ -507,7 +507,7 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSe
ctx: s.ctx,
txInputs: []testTx{testTxs[9], testTxs[10], testTxs[11]},
req: &abci.RequestPrepareProposal{
MaxTxBytes: 195 + 196,
MaxTxBytes: 263 + 264,
},
expectedTxs: []int{9},
},
Expand Down Expand Up @@ -571,9 +571,7 @@ func marshalDelimitedFn(msg proto.Message) ([]byte, error) {
func buildMsg(t *testing.T, txConfig client.TxConfig, value []byte, secrets [][]byte, nonces []uint64) sdk.Tx {
t.Helper()
builder := txConfig.NewTxBuilder()
_ = builder.SetMsgs(
&baseapptestutil.MsgKeyValue{Value: value},
)

require.Equal(t, len(secrets), len(nonces))
signatures := make([]signingtypes.SignatureV2, 0)
for index, secret := range secrets {
Expand All @@ -586,6 +584,14 @@ func buildMsg(t *testing.T, txConfig client.TxConfig, value []byte, secrets [][]
Data: &signingtypes.SingleSignatureData{},
})
}

_ = builder.SetMsgs(
&baseapptestutil.MsgKeyValue{
Signer: sdk.AccAddress(signatures[0].PubKey.Bytes()).String(),
Value: value,
},
)

setTxSignatureWithSecret(t, builder, signatures...)
return builder.GetTx()
}
Expand Down
1 change: 1 addition & 0 deletions x/tx/signing/textual/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestE2EJSONTestcases(t *testing.T) {
BodyBytes: bodyBz,
AuthInfoBytes: authInfoBz,
})
require.NoError(t, err)
decodeWant, err := hex.DecodeString(tc.Cbor)
require.NoError(t, err)
t.Log("got: " + string(signDoc))
Expand Down

0 comments on commit 4c0d6c7

Please sign in to comment.