Documentation ¶
Index ¶
- Variables
- type Driver
- func (d *Driver) AddInstance(instance *Instance)
- func (d *Driver) RequireCommit(round uint64, vote gpbft.ECChain, justification *gpbft.Justification)
- func (d *Driver) RequireCommitForBottom(round uint64)
- func (d *Driver) RequireConverge(round uint64, vote gpbft.ECChain, justification *gpbft.Justification)
- func (d *Driver) RequireDecide(vote gpbft.ECChain, justification *gpbft.Justification)
- func (d *Driver) RequireDecision(instanceID uint64, expect gpbft.ECChain)
- func (d *Driver) RequireDeliverAlarm()
- func (d *Driver) RequireDeliverMessage(message *gpbft.GMessage)
- func (d *Driver) RequireErrOnDeliverMessage(message *gpbft.GMessage, err error, contains string)
- func (d *Driver) RequireNoBroadcast()
- func (d *Driver) RequirePrepare(value gpbft.ECChain)
- func (d *Driver) RequirePrepareAtRound(round uint64, value gpbft.ECChain, justification *gpbft.Justification)
- func (d *Driver) RequireQuality()
- func (d *Driver) StartInstance(id uint64)
- type Instance
- func (i *Instance) GetDecision() *gpbft.Justification
- func (i *Instance) ID() uint64
- func (i *Instance) NewCommit(round uint64, proposal gpbft.ECChain) gpbft.Payload
- func (i *Instance) NewConverge(round uint64, proposal gpbft.ECChain) gpbft.Payload
- func (i *Instance) NewDecide(round uint64, proposal gpbft.ECChain) gpbft.Payload
- func (i *Instance) NewJustification(round uint64, step gpbft.Phase, vote gpbft.ECChain, from ...gpbft.ActorID) *gpbft.Justification
- func (i *Instance) NewMessageBuilder(payload gpbft.Payload, justification *gpbft.Justification, withTicket bool) *gpbft.MessageBuilder
- func (i *Instance) NewPayload(round uint64, step gpbft.Phase, value gpbft.ECChain) gpbft.Payload
- func (i *Instance) NewPrepare(round uint64, proposal gpbft.ECChain) gpbft.Payload
- func (i *Instance) NewQuality(proposal gpbft.ECChain) gpbft.Payload
- func (i *Instance) PowerTable() *gpbft.PowerTable
- func (i *Instance) Proposal() gpbft.ECChain
- func (i *Instance) SupplementalData() gpbft.SupplementalData
Constants ¶
This section is empty.
Variables ¶
var ValidTicket gpbft.Ticket = []byte("filled in by driver")
ValidTicket is a sentinel value to generate and set a valid gpbft.Ticket when delivering messages via Driver.deliverMessage.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver drives the emulation of a GPBFT instance for one honest participant, and allows frame-by-frame control over progress of a GPBFT instance.
func NewDriver ¶
NewDriver instantiates a new Driver with the given GPBFT options. See Driver.StartInstance.
func (*Driver) AddInstance ¶
AddInstance adds an instance to the list of instances known by the driver.
func (*Driver) RequireCommit ¶
func (*Driver) RequireCommitForBottom ¶
func (*Driver) RequireConverge ¶
func (*Driver) RequireDecide ¶
func (d *Driver) RequireDecide(vote gpbft.ECChain, justification *gpbft.Justification)
func (*Driver) RequireDecision ¶
func (*Driver) RequireDeliverAlarm ¶
func (d *Driver) RequireDeliverAlarm()
func (*Driver) RequireDeliverMessage ¶
func (*Driver) RequireErrOnDeliverMessage ¶
func (*Driver) RequireNoBroadcast ¶
func (d *Driver) RequireNoBroadcast()
func (*Driver) RequirePrepare ¶
func (*Driver) RequirePrepareAtRound ¶
func (*Driver) RequireQuality ¶
func (d *Driver) RequireQuality()
func (*Driver) StartInstance ¶
StartInstance sets the current instances and starts emulation for it by signalling the start of instance to the emulated honest gpbft.Participant.
See NewInstance.
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance represents a GPBFT instance capturing all the information necessary for GPBFT to function, along with the final decision reached if any.
func NewInstance ¶
func NewInstance(t *testing.T, id uint64, powerEntries gpbft.PowerEntries, proposal ...gpbft.TipSet) *Instance
NewInstance instantiates a new Instance for emulation. If absent, the constructor will implicitly generate any missing but required values such as public keys Power Table CID, etc. for the given params. The given proposal must contain at least one tipset.
See Driver.StartInstance.
func (*Instance) GetDecision ¶
func (i *Instance) GetDecision() *gpbft.Justification
func (*Instance) NewConverge ¶
func (*Instance) NewJustification ¶
func (*Instance) NewMessageBuilder ¶
func (i *Instance) NewMessageBuilder(payload gpbft.Payload, justification *gpbft.Justification, withTicket bool) *gpbft.MessageBuilder
func (*Instance) NewPayload ¶
func (*Instance) NewPrepare ¶
func (*Instance) PowerTable ¶ added in v0.0.4
func (i *Instance) PowerTable() *gpbft.PowerTable
func (*Instance) SupplementalData ¶
func (i *Instance) SupplementalData() gpbft.SupplementalData