standard_merkle_tree

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const SOL_ADDRESS = "address"
View Source
const SOL_ADDRESS_ARRAY = "address[]"
View Source
const SOL_BOOL = "bool"
View Source
const SOL_BOOL_ARRAY = "bool[]"
View Source
const SOL_BYTES = "bytes"
View Source
const SOL_BYTES1 = "bytes1"
View Source
const SOL_BYTES10 = "bytes10"
View Source
const SOL_BYTES10_ARRAY = "bytes10[]"
View Source
const SOL_BYTES11 = "bytes11"
View Source
const SOL_BYTES11_ARRAY = "bytes11[]"
View Source
const SOL_BYTES12 = "bytes12"
View Source
const SOL_BYTES12_ARRAY = "bytes12[]"
View Source
const SOL_BYTES13 = "bytes13"
View Source
const SOL_BYTES13_ARRAY = "bytes13[]"
View Source
const SOL_BYTES14 = "bytes14"
View Source
const SOL_BYTES14_ARRAY = "bytes14[]"
View Source
const SOL_BYTES15 = "bytes15"
View Source
const SOL_BYTES15_ARRAY = "bytes15[]"
View Source
const SOL_BYTES16 = "bytes16"
View Source
const SOL_BYTES16_ARRAY = "bytes16[]"
View Source
const SOL_BYTES17 = "bytes17"
View Source
const SOL_BYTES17_ARRAY = "bytes17[]"
View Source
const SOL_BYTES18 = "bytes18"
View Source
const SOL_BYTES18_ARRAY = "bytes18[]"
View Source
const SOL_BYTES19 = "bytes19"
View Source
const SOL_BYTES19_ARRAY = "bytes19[]"
View Source
const SOL_BYTES1_ARRAY = "bytes1[]"
View Source
const SOL_BYTES2 = "bytes2"
View Source
const SOL_BYTES20 = "bytes20"
View Source
const SOL_BYTES20_ARRAY = "bytes20[]"
View Source
const SOL_BYTES21 = "bytes21"
View Source
const SOL_BYTES21_ARRAY = "bytes21[]"
View Source
const SOL_BYTES22 = "bytes22"
View Source
const SOL_BYTES22_ARRAY = "bytes22[]"
View Source
const SOL_BYTES23 = "bytes23"
View Source
const SOL_BYTES23_ARRAY = "bytes23[]"
View Source
const SOL_BYTES24 = "bytes24"
View Source
const SOL_BYTES24_ARRAY = "bytes24[]"
View Source
const SOL_BYTES25 = "bytes25"
View Source
const SOL_BYTES25_ARRAY = "bytes25[]"
View Source
const SOL_BYTES26 = "bytes26"
View Source
const SOL_BYTES26_ARRAY = "bytes26[]"
View Source
const SOL_BYTES27 = "bytes27"
View Source
const SOL_BYTES27_ARRAY = "bytes27[]"
View Source
const SOL_BYTES28 = "bytes28"
View Source
const SOL_BYTES28_ARRAY = "bytes28[]"
View Source
const SOL_BYTES29 = "bytes29"
View Source
const SOL_BYTES29_ARRAY = "bytes29[]"
View Source
const SOL_BYTES2_ARRAY = "bytes2[]"
View Source
const SOL_BYTES3 = "bytes3"
View Source
const SOL_BYTES30 = "bytes30"
View Source
const SOL_BYTES30_ARRAY = "bytes30[]"
View Source
const SOL_BYTES31 = "bytes31"
View Source
const SOL_BYTES31_ARRAY = "bytes31[]"
View Source
const SOL_BYTES32 = "bytes32"
View Source
const SOL_BYTES32_ARRAY = "bytes32[]"
View Source
const SOL_BYTES3_ARRAY = "bytes3[]"
View Source
const SOL_BYTES4 = "bytes4"
View Source
const SOL_BYTES4_ARRAY = "bytes4[]"
View Source
const SOL_BYTES5 = "bytes5"
View Source
const SOL_BYTES5_ARRAY = "bytes5[]"
View Source
const SOL_BYTES6 = "bytes6"
View Source
const SOL_BYTES6_ARRAY = "bytes6[]"
View Source
const SOL_BYTES7 = "bytes7"
View Source
const SOL_BYTES7_ARRAY = "bytes7[]"
View Source
const SOL_BYTES8 = "bytes8"
View Source
const SOL_BYTES8_ARRAY = "bytes8[]"
View Source
const SOL_BYTES9 = "bytes9"
View Source
const SOL_BYTES9_ARRAY = "bytes9[]"
View Source
const SOL_BYTES_ARRAY = "bytes[]"
View Source
const SOL_INT104 = "int104"
View Source
const SOL_INT104_ARRAY = "int104[]"
View Source
const SOL_INT112 = "int112"
View Source
const SOL_INT112_ARRAY = "int112[]"
View Source
const SOL_INT120 = "int120"
View Source
const SOL_INT120_ARRAY = "int120[]"
View Source
const SOL_INT128 = "int128"
View Source
const SOL_INT128_ARRAY = "int128[]"
View Source
const SOL_INT136 = "int136"
View Source
const SOL_INT136_ARRAY = "int136[]"
View Source
const SOL_INT144 = "int144"
View Source
const SOL_INT144_ARRAY = "int144[]"
View Source
const SOL_INT152 = "int152"
View Source
const SOL_INT152_ARRAY = "int152[]"
View Source
const SOL_INT16 = "int16"
View Source
const SOL_INT160 = "int160"
View Source
const SOL_INT160_ARRAY = "int160[]"
View Source
const SOL_INT168 = "int168"
View Source
const SOL_INT168_ARRAY = "int168[]"
View Source
const SOL_INT16_ARRAY = "int16[]"
View Source
const SOL_INT176 = "int176"
View Source
const SOL_INT176_ARRAY = "int176[]"
View Source
const SOL_INT184 = "int184"
View Source
const SOL_INT184_ARRAY = "int184[]"
View Source
const SOL_INT192 = "int192"
View Source
const SOL_INT192_ARRAY = "int192[]"
View Source
const SOL_INT200 = "int200"
View Source
const SOL_INT200_ARRAY = "int200[]"
View Source
const SOL_INT208 = "int208"
View Source
const SOL_INT208_ARRAY = "int208[]"
View Source
const SOL_INT216 = "int216"
View Source
const SOL_INT216_ARRAY = "int216[]"
View Source
const SOL_INT224 = "int224"
View Source
const SOL_INT224_ARRAY = "int224[]"
View Source
const SOL_INT232 = "int232"
View Source
const SOL_INT232_ARRAY = "int232[]"
View Source
const SOL_INT24 = "int24"
View Source
const SOL_INT240 = "int240"
View Source
const SOL_INT240_ARRAY = "int240[]"
View Source
const SOL_INT248 = "int248"
View Source
const SOL_INT248_ARRAY = "int248[]"
View Source
const SOL_INT24_ARRAY = "int24[]"
View Source
const SOL_INT256 = "int256"
View Source
const SOL_INT256_ARRAY = "int256[]"
View Source
const SOL_INT32 = "int32"
View Source
const SOL_INT32_ARRAY = "int32[]"
View Source
const SOL_INT40 = "int40"
View Source
const SOL_INT40_ARRAY = "int40[]"
View Source
const SOL_INT48 = "int48"
View Source
const SOL_INT48_ARRAY = "int48[]"
View Source
const SOL_INT56 = "int56"
View Source
const SOL_INT56_ARRAY = "int56[]"
View Source
const SOL_INT64 = "int64"
View Source
const SOL_INT64_ARRAY = "int64[]"
View Source
const SOL_INT72 = "int72"
View Source
const SOL_INT72_ARRAY = "int72[]"
View Source
const SOL_INT8 = "int8"
View Source
const SOL_INT80 = "int80"
View Source
const SOL_INT80_ARRAY = "int80[]"
View Source
const SOL_INT88 = "int88"
View Source
const SOL_INT88_ARRAY = "int88[]"
View Source
const SOL_INT8_ARRAY = "int8[]"
View Source
const SOL_INT96 = "int96"
View Source
const SOL_INT96_ARRAY = "int96[]"
View Source
const SOL_STRING = "string"
View Source
const SOL_STRING_ARRAY = "string[]"
View Source
const SOL_UINT104 = "uint104"
View Source
const SOL_UINT104_ARRAY = "uint104[]"
View Source
const SOL_UINT112 = "uint112"
View Source
const SOL_UINT112_ARRAY = "uint112[]"
View Source
const SOL_UINT120 = "uint120"
View Source
const SOL_UINT120_ARRAY = "uint120[]"
View Source
const SOL_UINT128 = "uint128"
View Source
const SOL_UINT128_ARRAY = "uint128[]"
View Source
const SOL_UINT136 = "uint136"
View Source
const SOL_UINT136_ARRAY = "uint136[]"
View Source
const SOL_UINT144 = "uint144"
View Source
const SOL_UINT144_ARRAY = "uint144[]"
View Source
const SOL_UINT152 = "uint152"
View Source
const SOL_UINT152_ARRAY = "uint152[]"
View Source
const SOL_UINT16 = "uint16"
View Source
const SOL_UINT160 = "uint160"
View Source
const SOL_UINT160_ARRAY = "uint160[]"
View Source
const SOL_UINT168 = "uint168"
View Source
const SOL_UINT168_ARRAY = "uint168[]"
View Source
const SOL_UINT16_ARRAY = "uint16[]"
View Source
const SOL_UINT176 = "uint176"
View Source
const SOL_UINT176_ARRAY = "uint176[]"
View Source
const SOL_UINT184 = "uint184"
View Source
const SOL_UINT184_ARRAY = "uint184[]"
View Source
const SOL_UINT192 = "uint192"
View Source
const SOL_UINT192_ARRAY = "uint192[]"
View Source
const SOL_UINT200 = "uint200"
View Source
const SOL_UINT200_ARRAY = "uint200[]"
View Source
const SOL_UINT208 = "uint208"
View Source
const SOL_UINT208_ARRAY = "uint208[]"
View Source
const SOL_UINT216 = "uint216"
View Source
const SOL_UINT216_ARRAY = "uint216[]"
View Source
const SOL_UINT224 = "uint224"
View Source
const SOL_UINT224_ARRAY = "uint224[]"
View Source
const SOL_UINT232 = "uint232"
View Source
const SOL_UINT232_ARRAY = "uint232[]"
View Source
const SOL_UINT24 = "uint24"
View Source
const SOL_UINT240 = "uint240"
View Source
const SOL_UINT240_ARRAY = "uint240[]"
View Source
const SOL_UINT248 = "uint248"
View Source
const SOL_UINT248_ARRAY = "uint248[]"
View Source
const SOL_UINT24_ARRAY = "uint24[]"
View Source
const SOL_UINT256 = "uint256"
View Source
const SOL_UINT256_ARRAY = "uint256[]"
View Source
const SOL_UINT32 = "uint32"
View Source
const SOL_UINT32_ARRAY = "uint32[]"
View Source
const SOL_UINT40 = "uint40"
View Source
const SOL_UINT40_ARRAY = "uint40[]"
View Source
const SOL_UINT48 = "uint48"
View Source
const SOL_UINT48_ARRAY = "uint48[]"
View Source
const SOL_UINT56 = "uint56"
View Source
const SOL_UINT56_ARRAY = "uint56[]"
View Source
const SOL_UINT64 = "uint64"
View Source
const SOL_UINT64_ARRAY = "uint64[]"
View Source
const SOL_UINT72 = "uint72"
View Source
const SOL_UINT72_ARRAY = "uint72[]"
View Source
const SOL_UINT8 = "uint8"
View Source
const SOL_UINT80 = "uint80"
View Source
const SOL_UINT80_ARRAY = "uint80[]"
View Source
const SOL_UINT88 = "uint88"
View Source
const SOL_UINT88_ARRAY = "uint88[]"
View Source
const SOL_UINT8_ARRAY = "uint8[]"
View Source
const SOL_UINT96 = "uint96"
View Source
const SOL_UINT96_ARRAY = "uint96[]"

Variables

This section is empty.

Functions

func AbiPack

func AbiPack(types []string, values ...interface{}) ([]byte, error)

func Keccak256

func Keccak256(value []byte) ([]byte, error)

func LeafHash

func LeafHash(leafEncodings []string, values []interface{}) ([]byte, error)

func SolAddress

func SolAddress(value string) common.Address

func SolAddressArray added in v1.1.1

func SolAddressArray(value []interface{}) []common.Address

func SolBool

func SolBool(value bool) bool

func SolBoolArray added in v1.1.1

func SolBoolArray(value []interface{}) []bool

func SolBytes

func SolBytes(value string) []byte

func SolBytesArray added in v1.1.1

func SolBytesArray(value []interface{}) [][]byte

func SolNumber

func SolNumber(value string) *big.Int

func SolNumberArray added in v1.1.1

func SolNumberArray(value []interface{}) []*big.Int

func SolString

func SolString(value string) string

func SolStringArray added in v1.1.1

func SolStringArray(value []interface{}) []string

func ToJsonValue added in v1.1.2

func ToJsonValue(value interface{}, leafEncoding string) interface{}

func ToSolValue added in v1.1.2

func ToSolValue(value interface{}, leafEncoding string) interface{}

func Verify

func Verify(rootHash []byte, leaf []byte, proof [][]byte) (bool, error)

func VerifyMultiProof

func VerifyMultiProof(rootHash []byte, multiProof *MultiProof) (bool, error)

Types

type LeafValue

type LeafValue struct {
	ValueIndex int
	TreeIndex  int
	Hash       []byte
	Value      []interface{}
}

func (*LeafValue) ToString

func (l *LeafValue) ToString() string

type MultiProof

type MultiProof struct {
	Proof      [][]byte
	ProofFlags []bool
	Leaves     [][]byte
}

type StandardMerkleLeafProofData

type StandardMerkleLeafProofData struct {
	Value []interface{} `json:"value"`
	Proof []string      `json:"proof"`
}

type StandardMerkleTreeData

type StandardMerkleTreeData struct {
	Format       string               `json:"format"`
	Tree         []string             `json:"tree"`
	Values       []*StandardValueData `json:"values"`
	LeafEncoding []string             `json:"leafEncoding"`
}

type StandardMerkleTreeProofData

type StandardMerkleTreeProofData struct {
	Root         string                         `json:"root"`
	LeafEncoding []string                       `json:"leafEncoding"`
	Proofs       []*StandardMerkleLeafProofData `json:"leafProof"`
}

type StandardTree

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

func CreateTree

func CreateTree(leafEncodings []string) (*StandardTree, error)

func Load

func Load(value []byte) (*StandardTree, error)

func Of

func Of(leaves [][]interface{}, leafEncodings []string) (*StandardTree, error)

func TreeUnmarshal

func TreeUnmarshal(value []byte) (*StandardTree, error)

func (*StandardTree) AddLeaf

func (st *StandardTree) AddLeaf(values []interface{}) ([]byte, error)

func (*StandardTree) Dump

func (*StandardTree) DumpLeafProof

func (st *StandardTree) DumpLeafProof() (*StandardMerkleTreeProofData, error)

func (*StandardTree) Entries

func (st *StandardTree) Entries() []*LeafValue

func (*StandardTree) GetMultiProof

func (st *StandardTree) GetMultiProof(leaves [][]interface{}) (*ValueMultiProof, error)

func (*StandardTree) GetMultiProofWithIndices

func (st *StandardTree) GetMultiProofWithIndices(indices []int) (*ValueMultiProof, error)

func (*StandardTree) GetProof

func (st *StandardTree) GetProof(leaf []interface{}) ([][]byte, error)

func (*StandardTree) GetProofWithIndex

func (st *StandardTree) GetProofWithIndex(valueIndex int) ([][]byte, error)

func (*StandardTree) GetRoot

func (st *StandardTree) GetRoot() []byte

func (*StandardTree) LeafHash

func (st *StandardTree) LeafHash(values []interface{}) ([]byte, error)

func (*StandardTree) LeafHashWithIndex

func (st *StandardTree) LeafHashWithIndex(index int) ([]byte, error)

func (*StandardTree) MakeTree

func (st *StandardTree) MakeTree() ([]byte, error)

func (*StandardTree) TreeMarshal

func (st *StandardTree) TreeMarshal() ([]byte, error)

func (*StandardTree) TreeProofMarshal

func (st *StandardTree) TreeProofMarshal() ([]byte, error)

func (*StandardTree) Verify

func (st *StandardTree) Verify(proof [][]byte, leaf []interface{}) (bool, error)

func (*StandardTree) VerifyMultiProof

func (st *StandardTree) VerifyMultiProof(multiProof *ValueMultiProof) (bool, error)

func (*StandardTree) VerifyWithIndex

func (st *StandardTree) VerifyWithIndex(proof [][]byte, index int) (bool, error)

type StandardValueData

type StandardValueData struct {
	Value     []interface{} `json:"value"`
	TreeIndex int           `json:"treeIndex"`
}

type ValueMultiProof

type ValueMultiProof struct {
	Proof      [][]byte
	ProofFlags []bool
	Values     [][]interface{}
}

Jump to

Keyboard shortcuts

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