Documentation ¶
Index ¶
- func NewFinalizedHeaderCache(t *testing.T, state protocol.State) *finalizedHeaderCache
- type EpochQuery
- func (mock *EpochQuery) Add(epoch protocol.Epoch)
- func (mock *EpochQuery) ByCounter(counter uint64) protocol.Epoch
- func (mock *EpochQuery) Current() protocol.Epoch
- func (mock *EpochQuery) Next() protocol.Epoch
- func (mock *EpochQuery) Phase() flow.EpochPhase
- func (mock *EpochQuery) Previous() protocol.Epoch
- func (mock *EpochQuery) Transition()
- type Params
- func (p *Params) ChainID() (flow.ChainID, error)
- func (p *Params) EpochCommitSafetyThreshold() (uint64, error)
- func (p *Params) EpochFallbackTriggered() (bool, error)
- func (p *Params) FinalizedRoot() (*flow.Header, error)
- func (p *Params) ProtocolVersion() (uint, error)
- func (p *Params) Seal() (*flow.Seal, error)
- func (p *Params) SealedRoot() (*flow.Header, error)
- func (p *Params) SporkID() (flow.Identifier, error)
- func (p *Params) SporkRootBlockHeight() (uint64, error)
- type ProtocolState
- func (ps *ProtocolState) AtBlockID(blockID flow.Identifier) protocol.Snapshot
- func (ps *ProtocolState) AtHeight(height uint64) protocol.Snapshot
- func (m *ProtocolState) Bootstrap(root *flow.Block, result *flow.ExecutionResult, seal *flow.Seal) error
- func (m *ProtocolState) Extend(block *flow.Block) error
- func (ps *ProtocolState) Final() protocol.Snapshot
- func (m *ProtocolState) Finalize(blockID flow.Identifier) error
- func (ps *ProtocolState) Params() protocol.Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EpochQuery ¶
type EpochQuery struct {
// contains filtered or unexported fields
}
EpochQuery implements protocol.EpochQuery for testing purposes. Safe for concurrent use by multiple goroutines.
func NewEpochQuery ¶
func (*EpochQuery) Add ¶
func (mock *EpochQuery) Add(epoch protocol.Epoch)
func (*EpochQuery) Current ¶
func (mock *EpochQuery) Current() protocol.Epoch
func (*EpochQuery) Next ¶
func (mock *EpochQuery) Next() protocol.Epoch
func (*EpochQuery) Phase ¶ added in v0.31.0
func (mock *EpochQuery) Phase() flow.EpochPhase
Phase returns a phase consistent with the current epoch state.
func (*EpochQuery) Previous ¶ added in v0.13.0
func (mock *EpochQuery) Previous() protocol.Epoch
func (*EpochQuery) Transition ¶
func (mock *EpochQuery) Transition()
type Params ¶ added in v0.11.0
type Params struct {
// contains filtered or unexported fields
}
func (*Params) EpochCommitSafetyThreshold ¶ added in v0.29.0
func (*Params) EpochFallbackTriggered ¶ added in v0.29.0
func (*Params) FinalizedRoot ¶ added in v0.30.7
func (*Params) ProtocolVersion ¶ added in v0.23.2
func (*Params) SporkRootBlockHeight ¶ added in v0.29.6
type ProtocolState ¶ added in v0.11.0
type ProtocolState struct { sync.Mutex protocol.ParticipantState // contains filtered or unexported fields }
ProtocolState is a mocked version of protocol state, which has very close behavior to the real implementation but for testing purpose. If you are testing a module that depends on protocol state's behavior, but you don't want to mock up the methods and its return value, then just use this module
func NewProtocolState ¶ added in v0.11.0
func NewProtocolState() *ProtocolState
func (*ProtocolState) AtBlockID ¶ added in v0.11.0
func (ps *ProtocolState) AtBlockID(blockID flow.Identifier) protocol.Snapshot
func (*ProtocolState) AtHeight ¶ added in v0.11.0
func (ps *ProtocolState) AtHeight(height uint64) protocol.Snapshot
func (*ProtocolState) Bootstrap ¶ added in v0.14.0
func (m *ProtocolState) Bootstrap(root *flow.Block, result *flow.ExecutionResult, seal *flow.Seal) error
func (*ProtocolState) Extend ¶ added in v0.14.0
func (m *ProtocolState) Extend(block *flow.Block) error
func (*ProtocolState) Final ¶ added in v0.11.0
func (ps *ProtocolState) Final() protocol.Snapshot
func (*ProtocolState) Finalize ¶ added in v0.14.0
func (m *ProtocolState) Finalize(blockID flow.Identifier) error
func (*ProtocolState) Params ¶ added in v0.11.0
func (ps *ProtocolState) Params() protocol.Params
Click to show internal directories.
Click to hide internal directories.