github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/verification/common.go (about)

     1  package verification
     2  
     3  import (
     4  	"github.com/koko1123/flow-go-1/model/flow"
     5  )
     6  
     7  // MakeVoteMessage generates the message we have to sign in order to be able
     8  // to verify signatures without having the full block. To that effect, each data
     9  // structure that is signed contains the sometimes redundant view number and
    10  // block ID; this allows us to create the signed message and verify the signed
    11  // message without having the full block contents.
    12  func MakeVoteMessage(view uint64, blockID flow.Identifier) []byte {
    13  	msg := flow.MakeID(struct {
    14  		BlockID flow.Identifier
    15  		View    uint64
    16  	}{
    17  		BlockID: blockID,
    18  		View:    view,
    19  	})
    20  	return msg[:]
    21  }