mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 06:54:41 +00:00
Refactor so building and linting works
This is the first step towards implementing vote extensions: generating the relevant proto stubs and getting the build and linter to pass. Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -310,21 +310,25 @@ func (blockExec *BlockExecutor) ApplyBlock(
|
||||
return state, nil
|
||||
}
|
||||
|
||||
func (blockExec *BlockExecutor) ExtendVote(ctx context.Context, vote *types.Vote) (types.VoteExtension, error) {
|
||||
func (blockExec *BlockExecutor) ExtendVote(ctx context.Context, vote *types.Vote) ([]byte, error) {
|
||||
req := abci.RequestExtendVote{
|
||||
Vote: vote.ToProto(),
|
||||
Hash: vote.BlockID.Hash,
|
||||
Height: vote.Height,
|
||||
}
|
||||
|
||||
resp, err := blockExec.appClient.ExtendVote(ctx, req)
|
||||
if err != nil {
|
||||
return types.VoteExtension{}, err
|
||||
return nil, err
|
||||
}
|
||||
return types.VoteExtensionFromProto(resp.VoteExtension), nil
|
||||
return resp.VoteExtension, nil
|
||||
}
|
||||
|
||||
func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) error {
|
||||
req := abci.RequestVerifyVoteExtension{
|
||||
Vote: vote.ToProto(),
|
||||
Hash: []byte{},
|
||||
ValidatorAddress: []byte{},
|
||||
Height: 0,
|
||||
VoteExtension: []byte{},
|
||||
}
|
||||
|
||||
resp, err := blockExec.appClient.VerifyVoteExtension(ctx, req)
|
||||
@@ -332,7 +336,7 @@ func (blockExec *BlockExecutor) VerifyVoteExtension(ctx context.Context, vote *t
|
||||
return err
|
||||
}
|
||||
|
||||
if resp.IsErr() {
|
||||
if !resp.Accept {
|
||||
return types.ErrVoteInvalidExtension
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user