Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertProofNode(nodes []*ProofNode) []contract.ProofLibProofNode
- func IndexToKey(index, total int) []byte
- func MinReprBytes(numKeys int) (keyLen int)
- func Prove(root common.Hash, key, value []byte, proofNodes []*ProofNode) bool
- func ToIndexBytes(index, keyLen int) []byte
- type NibblePath
- func (path *NibblePath) CommonPrefix(other *NibblePath) (prefix, path1, path2 NibblePath)
- func (path *NibblePath) ComputeMerkle(nodeMerkle common.Hash) common.Hash
- func (path *NibblePath) Length() int
- func (path *NibblePath) ToChild() (childIndex byte, childPath NibblePath, ok bool)
- func (path *NibblePath) Trim() NibblePath
- type Node
- type ProofNode
Constants ¶
View Source
const CHILDREN_COUNT = 16
Variables ¶
View Source
var ( KECCAKE_EMPTY = crypto.Keccak256Hash() LEAF_NODE_CHILDREN = [CHILDREN_COUNT]common.Hash{ KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, KECCAKE_EMPTY, } )
Functions ¶
func ConvertProofNode ¶
func ConvertProofNode(nodes []*ProofNode) []contract.ProofLibProofNode
func IndexToKey ¶
func MinReprBytes ¶
func ToIndexBytes ¶
Types ¶
type NibblePath ¶
type NibblePath struct {
// contains filtered or unexported fields
}
func NewNibblePath ¶
func NewNibblePath(key []byte) NibblePath
func (*NibblePath) CommonPrefix ¶
func (path *NibblePath) CommonPrefix(other *NibblePath) (prefix, path1, path2 NibblePath)
func (*NibblePath) ComputeMerkle ¶
func (path *NibblePath) ComputeMerkle(nodeMerkle common.Hash) common.Hash
func (*NibblePath) Length ¶
func (path *NibblePath) Length() int
func (*NibblePath) ToChild ¶
func (path *NibblePath) ToChild() (childIndex byte, childPath NibblePath, ok bool)
func (*NibblePath) Trim ¶
func (path *NibblePath) Trim() NibblePath
Click to show internal directories.
Click to hide internal directories.