|
|
@ -4,8 +4,8 @@ import ( |
|
|
|
"github.com/Trapesys/go-ibft/messages/proto" |
|
|
|
"github.com/Trapesys/go-ibft/messages/proto" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// messageConstructor defines a message constructor interface
|
|
|
|
// MessageConstructor defines a message constructor interface
|
|
|
|
type messageConstructor interface { |
|
|
|
type MessageConstructor interface { |
|
|
|
// BuildPrePrepareMessage builds a PREPREPARE message based on the passed in proposal
|
|
|
|
// BuildPrePrepareMessage builds a PREPREPARE message based on the passed in proposal
|
|
|
|
BuildPrePrepareMessage(proposal []byte, view *proto.View) *proto.Message |
|
|
|
BuildPrePrepareMessage(proposal []byte, view *proto.View) *proto.Message |
|
|
|
|
|
|
|
|
|
|
@ -19,8 +19,8 @@ type messageConstructor interface { |
|
|
|
BuildRoundChangeMessage(height, round uint64) *proto.Message |
|
|
|
BuildRoundChangeMessage(height, round uint64) *proto.Message |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// validator defines the validator interface
|
|
|
|
// Verifier defines the verifier interface
|
|
|
|
type validator interface { |
|
|
|
type Verifier interface { |
|
|
|
// IsValidBlock checks if the proposed block is child of parent
|
|
|
|
// IsValidBlock checks if the proposed block is child of parent
|
|
|
|
IsValidBlock(block []byte) bool |
|
|
|
IsValidBlock(block []byte) bool |
|
|
|
|
|
|
|
|
|
|
@ -40,8 +40,8 @@ type validator interface { |
|
|
|
// Backend defines an interface all backend implementations
|
|
|
|
// Backend defines an interface all backend implementations
|
|
|
|
// need to implement
|
|
|
|
// need to implement
|
|
|
|
type Backend interface { |
|
|
|
type Backend interface { |
|
|
|
messageConstructor |
|
|
|
MessageConstructor |
|
|
|
validator |
|
|
|
Verifier |
|
|
|
|
|
|
|
|
|
|
|
// BuildProposal builds a new block proposal
|
|
|
|
// BuildProposal builds a new block proposal
|
|
|
|
BuildProposal(blockNumber uint64) ([]byte, error) |
|
|
|
BuildProposal(blockNumber uint64) ([]byte, error) |
|
|
|