github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/integration/signer_test.go (about) 1 package integration_test 2 3 import ( 4 "github.com/onflow/flow-go/consensus/hotstuff/model" 5 "github.com/onflow/flow-go/model/flow" 6 ) 7 8 type Signer struct { 9 localID flow.Identifier 10 } 11 12 func (*Signer) CreateProposal(block *model.Block) (*model.Proposal, error) { 13 proposal := &model.Proposal{ 14 Block: block, 15 SigData: nil, 16 } 17 return proposal, nil 18 } 19 func (s *Signer) CreateVote(block *model.Block) (*model.Vote, error) { 20 vote := &model.Vote{ 21 View: block.View, 22 BlockID: block.BlockID, 23 SignerID: s.localID, 24 SigData: nil, 25 } 26 return vote, nil 27 } 28 func (*Signer) CreateQC(votes []*model.Vote) (*flow.QuorumCertificate, error) { 29 qc := &flow.QuorumCertificate{ 30 View: votes[0].View, 31 BlockID: votes[0].BlockID, 32 SignerIndices: nil, 33 SigData: nil, 34 } 35 return qc, nil 36 } 37 38 func (*Signer) VerifyVote(voterID *flow.Identity, sigData []byte, block *model.Block) error { 39 return nil 40 } 41 42 func (*Signer) VerifyQC(voters flow.IdentityList, sigData []byte, block *model.Block) error { 43 return nil 44 }