Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCoderFromBytes(data []byte) (*coder.MerkleTree, error)
- func BuildCoderFromTree(t *Tree) *coder.MerkleTree
- type Tree
- func (t *Tree) CalculateHash() (string, error)
- func (t *Tree) CalculateHashBytes() ([]byte, error)
- func (t *Tree) Deserialize(data []byte) error
- func (t *Tree) DeserializeString(hexStr string) error
- func (t *Tree) Equals(other merkletree.Content) (bool, error)
- func (t *Tree) MarshalJSON() ([]byte, error)
- func (t *Tree) Props() TreeProps
- func (t *Tree) Serialize() ([]byte, error)
- func (t *Tree) SerializeString() (string, error)
- func (t *Tree) SetHash() error
- func (t *Tree) UnmarshalJSON(data []byte) error
- type TreeProps
Constants ¶
View Source
const ( // StatechainBlocksKindStr ... StatechainBlocksKindStr = "statechainBlocks" // MainchainBlocksKindStr ... MainchainBlocksKindStr = "mainchainBlocks" // TransactionsKindStr ... TransactionsKindStr = "transactions" // DiffsKindStr ... DiffsKindStr = "diffs" // MerkleTreesKindStr ... MerkleTreesKindStr = "merkleTrees" )
Variables ¶
View Source
var ( // ErrUnknownKind ... ErrUnknownKind = errors.New("unknown kind") // ErrNilChainObjects ... ErrNilChainObjects = errors.New("nil chain objects") // ErrNilChainObject ... ErrNilChainObject = errors.New("nil chain object") // ErrInconsistentKinds ... ErrInconsistentKinds = errors.New("inconsistent kinds") // ErrNilMerkleTree ... ErrNilMerkleTree = errors.New("merkle tree is nil") // ErrNilMerkleTreeRootHash ... ErrNilMerkleTreeRootHash = errors.New("merkle tree hash is nil") // ErrNilProps ... ErrNilProps = errors.New("props are nil") )
Functions ¶
func BuildCoderFromBytes ¶
func BuildCoderFromBytes(data []byte) (*coder.MerkleTree, error)
BuildCoderFromBytes ...
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree ...
func BuildFromObjects ¶
func BuildFromObjects(chainObjects []merkletree.Content, kind string) (*Tree, error)
BuildFromObjects ... note: using this method to keep with our New function accepting props TODO: ensure that all of the kinds are the same? TODO ensure that the kind is the true kind?
func (*Tree) CalculateHash ¶
CalculateHash ... note: this function doesn't actually calculate the hash but returns the root hash
func (*Tree) CalculateHashBytes ¶
CalculateHashBytes ...
func (*Tree) DeserializeString ¶
DeserializeString ...
type TreeProps ¶
TreeProps ...
func BuildTreePropsFromBytes ¶
BuildTreePropsFromBytes ...
func BuildTreePropsFromCoder ¶
func BuildTreePropsFromCoder(tmp *coder.MerkleTree) (*TreeProps, error)
BuildTreePropsFromCoder ...
Click to show internal directories.
Click to hide internal directories.