Documentation ¶
Index ¶
- type HeightView
- type State
- func (s *State) CancelContextIfHeightViewUnchanged(cancel context.CancelFunc, height primitives.BlockHeight, view primitives.View) (*HeightView, bool)
- func (s *State) CompareWithEffectiveHeightAndCancel(cancel context.CancelFunc, lastUpdated primitives.BlockHeight, ...) (*HeightView, bool)
- func (s *State) Height() primitives.BlockHeight
- func (s *State) HeightView() *HeightView
- func (s *State) SetHeightAndResetView(ctx context.Context, newHeight primitives.BlockHeight) (*HeightView, error)
- func (s *State) SetHeightView(ctx context.Context, newHeight primitives.BlockHeight, newView primitives.View) (*HeightView, error)
- func (s *State) SetView(ctx context.Context, newView primitives.View) (*HeightView, error)
- func (s *State) View() primitives.View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeightView ¶
type HeightView struct {
// contains filtered or unexported fields
}
Immutable instance of height+view
func NewHeightView ¶
func NewHeightView(h primitives.BlockHeight, v primitives.View) *HeightView
func (*HeightView) Height ¶
func (hv *HeightView) Height() primitives.BlockHeight
func (*HeightView) String ¶
func (hv *HeightView) String() string
func (*HeightView) View ¶
func (hv *HeightView) View() primitives.View
type State ¶
Mutable, goroutine-safe State object
func (*State) CancelContextIfHeightViewUnchanged ¶
func (s *State) CancelContextIfHeightViewUnchanged(cancel context.CancelFunc, height primitives.BlockHeight, view primitives.View) (*HeightView, bool)
func (*State) CompareWithEffectiveHeightAndCancel ¶
func (s *State) CompareWithEffectiveHeightAndCancel(cancel context.CancelFunc, lastUpdated primitives.BlockHeight, height primitives.BlockHeight) (*HeightView, bool)
func (*State) Height ¶
func (s *State) Height() primitives.BlockHeight
func (*State) HeightView ¶
func (s *State) HeightView() *HeightView
func (*State) SetHeightAndResetView ¶
func (s *State) SetHeightAndResetView(ctx context.Context, newHeight primitives.BlockHeight) (*HeightView, error)
func (*State) SetHeightView ¶
func (s *State) SetHeightView(ctx context.Context, newHeight primitives.BlockHeight, newView primitives.View) (*HeightView, error)
TODO For testing only, so perhaps move it away
func (*State) SetView ¶
func (s *State) SetView(ctx context.Context, newView primitives.View) (*HeightView, error)
func (*State) View ¶
func (s *State) View() primitives.View
Click to show internal directories.
Click to hide internal directories.