github.com/koko1123/flow-go-1@v0.29.6/module/builder.go (about) 1 // (c) 2019 Dapper Labs - ALL RIGHTS RESERVED 2 3 package module 4 5 import ( 6 "github.com/koko1123/flow-go-1/model/flow" 7 ) 8 9 // Builder represents an abstracted block construction module that can be used 10 // in more than one consensus algorithm. The resulting block is consistent 11 // within itself and can be wrapped with additional consensus information such 12 // as QCs. 13 type Builder interface { 14 15 // BuildOn generates a new payload that is valid with respect to the parent 16 // being built upon, with the view being provided by the consensus algorithm. 17 // The builder stores the block and validates it against the protocol state 18 // before returning it. 19 // 20 // NOTE: Since the block is stored within Builder, HotStuff MUST propose the 21 // block once BuildOn succcessfully returns. 22 BuildOn(parentID flow.Identifier, setter func(*flow.Header) error) (*flow.Header, error) 23 }