From 19e07c9a8c47144712c619268bf60dfa9e183ce5 Mon Sep 17 00:00:00 2001 From: Thane Thomson Date: Sun, 20 Mar 2022 13:33:16 -0400 Subject: [PATCH] Remove extraneous empty value initialization Signed-off-by: Thane Thomson --- internal/state/execution.go | 7 +------ privval/msgs_test.go | 18 ++++++++---------- types/vote_test.go | 17 +++++++---------- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/internal/state/execution.go b/internal/state/execution.go index 2664df9af..c27a7082d 100644 --- a/internal/state/execution.go +++ b/internal/state/execution.go @@ -324,12 +324,7 @@ func (blockExec *BlockExecutor) ExtendVote(ctx context.Context, vote *types.Vote } func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) error { - req := abci.RequestVerifyVoteExtension{ - Hash: []byte{}, - ValidatorAddress: []byte{}, - Height: 0, - VoteExtension: []byte{}, - } + req := abci.RequestVerifyVoteExtension{} resp, err := blockExec.appClient.VerifyVoteExtension(ctx, req) if err != nil { diff --git a/privval/msgs_test.go b/privval/msgs_test.go index 31f1f61a6..b211e2551 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -22,16 +22,14 @@ var stamp = time.Date(2019, 10, 13, 16, 14, 44, 0, time.UTC) func exampleVote() *types.Vote { return &types.Vote{ - Type: tmproto.SignedMsgType(1), - Height: 3, - Round: 2, - BlockID: types.BlockID{Hash: tmhash.Sum([]byte("blockID_hash")), PartSetHeader: types.PartSetHeader{Total: 1000000, Hash: tmhash.Sum([]byte("blockID_part_set_header_hash"))}}, - Timestamp: stamp, - ValidatorAddress: crypto.AddressHash([]byte("validator_address")), - ValidatorIndex: 56789, - Signature: []byte{}, - Extension: []byte("app_data_signed"), - ExtensionSignature: []byte{}, + Type: tmproto.SignedMsgType(1), + Height: 3, + Round: 2, + BlockID: types.BlockID{Hash: tmhash.Sum([]byte("blockID_hash")), PartSetHeader: types.PartSetHeader{Total: 1000000, Hash: tmhash.Sum([]byte("blockID_part_set_header_hash"))}}, + Timestamp: stamp, + ValidatorAddress: crypto.AddressHash([]byte("validator_address")), + ValidatorIndex: 56789, + Extension: []byte("app_data_signed"), } } diff --git a/types/vote_test.go b/types/vote_test.go index 9f77617e5..b6a4e92a5 100644 --- a/types/vote_test.go +++ b/types/vote_test.go @@ -131,16 +131,13 @@ func TestVoteSignBytesTestVectors(t *testing.T) { // containing vote extension 5: { "test_chain_id", &Vote{ - Type: 0, - Height: 1, - Round: 1, - BlockID: BlockID{}, - Timestamp: time.Time{}, - ValidatorAddress: []byte{}, - ValidatorIndex: 0, - Signature: []byte{}, - Extension: []byte("signed"), - ExtensionSignature: []byte{}, + Type: 0, + Height: 1, + Round: 1, + BlockID: BlockID{}, + Timestamp: time.Time{}, + ValidatorIndex: 0, + Extension: []byte("signed"), }, []byte{ 0x2e, // length