Skip to content

Commit

Permalink
Remove extraneous empty value initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Thane Thomson <connect@thanethomson.com>
  • Loading branch information
thanethomson committed Mar 20, 2022
1 parent 98c1bc5 commit 55bfcbc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
7 changes: 1 addition & 6 deletions internal/state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 8 additions & 10 deletions privval/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}

Expand Down
17 changes: 7 additions & 10 deletions types/vote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 55bfcbc

Please sign in to comment.