Documentation ¶
Overview ¶
Package jet provides methods for working with Jet objects.
Index ¶
- Variables
- func Encode(drop *JetDrop) ([]byte, error)
- func Jet(id core.RecordID) (uint8, []byte)
- func NewID(depth uint8, prefix []byte) *core.RecordID
- func Parent(id core.RecordID) core.RecordID
- func ResetBits(value []byte, start uint8) []byte
- type DropSize
- type DropSizeHistory
- type IDSet
- type JetDrop
- type Tree
- func (t *Tree) Bytes() []byte
- func (t *Tree) Find(id core.RecordID) (*core.RecordID, bool)
- func (t *Tree) LeafIDs() []core.RecordID
- func (t *Tree) Merge(newTree *Tree) *Tree
- func (t *Tree) ResetActual()
- func (t *Tree) Split(jetID core.RecordID) (*core.RecordID, *core.RecordID, error)
- func (t Tree) String() string
- func (t *Tree) Update(id core.RecordID, setActual bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ZeroJetID = *NewID(0, nil)
ZeroJetID is value of an empty Jet ID
Functions ¶
Types ¶
type DropSize ¶
type DropSize struct { JetID core.RecordID PulseNo core.PulseNumber DropSize uint64 Signature []byte }
DropSize contains info about size of drop
type DropSizeHistory ¶
type DropSizeHistory []DropSize
DropSizeHistory is chain of drop sizes
func DeserializeJetDropSizeHistory ¶
func DeserializeJetDropSizeHistory(ctx context.Context, buff []byte) (DropSizeHistory, error)
DeserializeJetDropSizeHistory deserializes DropSizeHistory
func (DropSizeHistory) Bytes ¶
func (dropSizeHistory DropSizeHistory) Bytes() []byte
Bytes serializes DropSizeHistory
type JetDrop ¶
type JetDrop struct { // Pulse number (probably we should save it too). Pulse core.PulseNumber // PrevHash is a hash of all record hashes belongs to previous pulse. PrevHash []byte // Hash is a hash of all record hashes belongs to one pulse and previous drop hash. Hash []byte }
JetDrop is a blockchain block. It contains hashes of the current block and the previous one.
type Tree ¶
type Tree struct {
Head *jet
}
Tree stores jet in a binary tree.
func (*Tree) Find ¶
Find returns jet for provided reference. If found jet is actual, the second argument will be true.
func (*Tree) ResetActual ¶
func (t *Tree) ResetActual()
ResetActual resets actual mark, which will signify uncertain state on nodes and require actualization.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.