Documentation ¶
Overview ¶
Package cs defines types to work with Chainscripts.
Index ¶
Constants ¶
const ( // CompleteEvidence characterizes a Complete Evidence. CompleteEvidence = "COMPLETE" // PendingEvidence characterizes a Pending Evidence. PendingEvidence = "PENDING" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct { State map[string]interface{} `json:"state"` Meta map[string]interface{} `json:"meta"` }
Link contains a state and meta data about the state.
func (*Link) GetPrevLinkHash ¶
GetPrevLinkHash returns the previous link hash as a bytes. It assumes the link is valid. It will return nilif the previous link hash is null.
func (*Link) GetPrevLinkHashString ¶
GetPrevLinkHashString returns the previous link hash as a string. It assumes the link is valid. It will return an empty string if the previous link hash is null.
func (*Link) GetPriority ¶
GetPriority returns the priority as a float64 It assumes the link is valid. If priority is nil, it will return -Infinity.
func (*Link) GetProcess ¶
GetProcess returns the process name as a string. It assumes the link is valid.
type Segment ¶
Segment contains a link and meta data about the link.
func (*Segment) GetEvidence ¶
GetEvidence returns the segment evidence
func (*Segment) GetLinkHash ¶
GetLinkHash returns the link ID as bytes. It assumes the segment is valid.
func (*Segment) GetLinkHashString ¶
GetLinkHashString returns the link ID as a string. It assumes the segment is valid.
func (*Segment) SetEvidence ¶
SetEvidence sets the segment evidence
type SegmentSlice ¶
type SegmentSlice []*Segment
SegmentSlice is a slice of segment pointers.
func (SegmentSlice) Less ¶
func (s SegmentSlice) Less(i, j int) bool
Less implements sort.Interface.Less.
func (SegmentSlice) Swap ¶
func (s SegmentSlice) Swap(i, j int)
Swap implements sort.Interface.Swap.