Remove extraneous empty value initialization

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-03-20 13:34:46 -04:00
parent 71d36953c3
commit 19e07c9a8c
3 changed files with 16 additions and 26 deletions
+1 -6
View File
@@ -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 {
+8 -10
View File
@@ -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"),
}
}
+7 -10
View File
@@ -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