Home Reference Source
public class | source

InterfaceMerkleTreeNode

Extends:

common/trees/Interface-Tree-Node~InterfaceTreeNode → InterfaceMerkleTreeNode

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

hash: *

Method Summary

Public Methods
public

deserializeNodeData(buffer: *, offset: *): *

public
public

validateTreeNode(validateMerkleTree: *): boolean

Private Methods
private

_changedNode(node: *)

When an Operation is done to a done, let's calculate its hash

private

compute the hash of a given node

private

_getValueToHash(node: *): *

It returns the Value to be hashed

private

_refreshHash(node: *): boolean

Recalculate the hash of a node if it is different and propagate the change to the root

private

check the hash of node ...

Public Constructors

public constructor() source

Public Members

public hash: * source

Public Methods

public deserializeNodeData(buffer: *, offset: *): * source

Params:

NameTypeAttributeDescription
buffer *
offset *

Return:

*

public serializeNodeData(): * source

Return:

*

public validateTreeNode(validateMerkleTree: *): boolean source

Params:

NameTypeAttributeDescription
validateMerkleTree *

Return:

boolean

Private Methods

private _changedNode(node: *) source

When an Operation is done to a done, let's calculate its hash

Params:

NameTypeAttributeDescription
node *

private _computeHash(): * source

compute the hash of a given node

Return:

*

private _getValueToHash(node: *): * source

It returns the Value to be hashed

Params:

NameTypeAttributeDescription
node *

return buffer

Return:

*

private _refreshHash(node: *): boolean source

Recalculate the hash of a node if it is different and propagate the change to the root

Params:

NameTypeAttributeDescription
node *

Return:

boolean

private _validateHash(node: *): boolean source

check the hash of node ... it must have an initial hash

Params:

NameTypeAttributeDescription
node *

Return:

boolean