claimtrie

package
v0.22.119 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2022 License: ISC Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaimTrie

type ClaimTrie struct {
	// contains filtered or unexported fields
}

ClaimTrie implements a Merkle Trie supporting linear history of commits.

func New

func New(cfg config.Config) (*ClaimTrie, error)

func (*ClaimTrie) AddClaim

func (ct *ClaimTrie) AddClaim(name []byte, op wire.OutPoint, id change.ClaimID, amt int64) error

AddClaim adds a Claim to the ClaimTrie.

func (*ClaimTrie) AddSupport

func (ct *ClaimTrie) AddSupport(name []byte, op wire.OutPoint, amt int64, id change.ClaimID) error

AddSupport adds a Support to the ClaimTrie.

func (*ClaimTrie) AppendBlock

func (ct *ClaimTrie) AppendBlock(temporary bool) error

AppendBlock increases block by one.

func (*ClaimTrie) Close

func (ct *ClaimTrie) Close()

Close persists states. Any calls to the ClaimTrie after Close() being called results undefined behaviour.

func (*ClaimTrie) FlushToDisk

func (ct *ClaimTrie) FlushToDisk()

func (*ClaimTrie) Height

func (ct *ClaimTrie) Height() int32

Height returns the current block height.

func (*ClaimTrie) MerkleHash

func (ct *ClaimTrie) MerkleHash() *chainhash.Hash

MerkleHash returns the Merkle Hash of the claimTrie.

func (*ClaimTrie) NamesChangedInBlock

func (ct *ClaimTrie) NamesChangedInBlock(height int32) ([]string, error)

func (*ClaimTrie) NodeAt

func (ct *ClaimTrie) NodeAt(height int32, name []byte) (*node.Node, error)

func (*ClaimTrie) ResetHeight

func (ct *ClaimTrie) ResetHeight(height int32) error

ResetHeight resets the ClaimTrie to a previous known height..

func (*ClaimTrie) SpendClaim

func (ct *ClaimTrie) SpendClaim(name []byte, op wire.OutPoint, id change.ClaimID) error

SpendClaim spends a Claim in the ClaimTrie.

func (*ClaimTrie) SpendSupport

func (ct *ClaimTrie) SpendSupport(name []byte, op wire.OutPoint, id change.ClaimID) error

SpendSupport spends a Support in the ClaimTrie.

func (*ClaimTrie) UpdateClaim

func (ct *ClaimTrie) UpdateClaim(name []byte, op wire.OutPoint, amt int64, id change.ClaimID) error

UpdateClaim updates a Claim in the ClaimTrie.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL