Documentation ¶
Index ¶
- Constants
- func DeserializeArgs(source []byte) ([]byte, []byte, *big.Int, error)
- func FromNibbles(data []byte) []byte
- func HashChildren(v, hash []byte) []byte
- func HashLeaf(value []byte) []byte
- func MerkleProve(path, root []byte) ([]byte, error)
- func ReadBytes(buffer []byte, offset int, count int) ([]byte, int, error)
- func ReadUInt255(buffer []byte, offset int) (*big.Int, int, error)
- func ReadVarBytes(buffer []byte, offset int) ([]byte, int, error)
- func ReadVarUInt(buffer []byte, offset int) (uint64, int, error)
- func ReadVarUInt16(buffer []byte, offset int) (uint64, int, error)
- func ReadVarUInt32(buffer []byte, offset int) (uint64, int, error)
- func ReadVarUInt64(buffer []byte, offset int) (uint64, int, error)
- func ReadVarUInt8(buffer []byte, offset int) (uint64, int, error)
- func ResolveProof(proofBytes []byte) (id int, key []byte, proof [][]byte, err error)
- func ToNibbles(data []byte) []byte
- func VerifyProof(root *helper.UInt256, id int, key []byte, proof [][]byte) ([]byte, error)
- type CrossChainTxParameter
- type IKVReadOnlyDb
- type Node
- func (n *Node) Deserialize(br *io.BinaryReader)
- func (n *Node) GetHash() *helper.UInt256
- func (n *Node) GetNodeType() NodeType
- func (n *Node) IsEmpty() bool
- func (n *Node) Serialize(bw *io.BinaryWriter)
- func (n *Node) SerializeAsChild(bw *io.BinaryWriter)
- func (n *Node) SetDirty()
- func (n *Node) Size() int
- func (n *Node) SizeAsChild() int
- func (n *Node) ToArrayWithoutReference() []byte
- type NodeType
- type ProofDb
- type StateRoot
- func (sr *StateRoot) Deserialize(br *io.BinaryReader)
- func (sr *StateRoot) DeserializeUnsigned(br *io.BinaryReader)
- func (sr *StateRoot) GetHash() *helper.UInt256
- func (sr *StateRoot) GetScriptHashesForVerifying() []*helper.UInt160
- func (sr *StateRoot) GetSize() int
- func (sr *StateRoot) GetWitnesses() []*tx.Witness
- func (sr *StateRoot) Serialize(bw *io.BinaryWriter)
- func (sr *StateRoot) SerializeUnsigned(bw *io.BinaryWriter)
- func (sr *StateRoot) SetWitnesses(data []*tx.Witness)
- type ToMerkleValue
- type Trie
Constants ¶
View Source
const BranchChildCount int = 17
View Source
const MaxKeyLength = (64 + 4) * 2
View Source
const MaxValueLength = 3 + 65535 + 1
Variables ¶
This section is empty.
Functions ¶
func DeserializeArgs ¶ added in v1.2.0
func FromNibbles ¶
func HashChildren ¶ added in v1.2.0
func MerkleProve ¶ added in v1.2.0
func ReadUInt255 ¶ added in v1.2.0
func ReadVarBytes ¶ added in v1.2.0
func ReadVarUInt16 ¶ added in v1.2.0
func ReadVarUInt32 ¶ added in v1.2.0
func ReadVarUInt64 ¶ added in v1.2.0
func ReadVarUInt8 ¶ added in v1.2.0
func ResolveProof ¶
ResolveProof get key and proofs from proofdata
Types ¶
type CrossChainTxParameter ¶ added in v1.2.0
type CrossChainTxParameter struct { TxHash []byte // source chain tx hash, when FromChainID = 2 (eth), it's a key CrossChainID []byte FromContract []byte ToChainID uint64 ToContract []byte Method []byte Args []byte }
func DeserializeCrossChainTxParameter ¶ added in v1.2.0
func DeserializeCrossChainTxParameter(source []byte, offset int) (*CrossChainTxParameter, error)
type IKVReadOnlyDb ¶
IKVReadOnlyDb to store data
type Node ¶
type Node struct { Reference int // BranchNode Children []Node // ExtensionNode Key []byte Next *Node // LeafNode Value []byte // contains filtered or unexported fields }
func NewBranchNode ¶
func NewBranchNode() *Node
func NewExtensionNode ¶
func NewHashNode ¶
func NewLeafNode ¶
func (*Node) Deserialize ¶
func (n *Node) Deserialize(br *io.BinaryReader)
func (*Node) GetNodeType ¶
func (*Node) Serialize ¶
func (n *Node) Serialize(bw *io.BinaryWriter)
func (*Node) SerializeAsChild ¶
func (n *Node) SerializeAsChild(bw *io.BinaryWriter)
func (*Node) SizeAsChild ¶
func (*Node) ToArrayWithoutReference ¶
type ProofDb ¶
type ProofDb struct {
// contains filtered or unexported fields
}
ProofDb a db to use for verify
func NewProofDb ¶
NewProofDb new instance of ProofDb from a string list
type StateRoot ¶
type StateRoot struct { Version byte `json:"version"` Index uint32 `json:"index"` RootHash string `json:"roothash"` Witnesses []models.RpcWitness `json:"witnesses"` }
StateRoot truct of StateRoot message
func (*StateRoot) Deserialize ¶
func (sr *StateRoot) Deserialize(br *io.BinaryReader)
func (*StateRoot) DeserializeUnsigned ¶
func (sr *StateRoot) DeserializeUnsigned(br *io.BinaryReader)
func (*StateRoot) GetScriptHashesForVerifying ¶ added in v0.3.3
func (*StateRoot) GetWitnesses ¶ added in v0.3.3
func (*StateRoot) Serialize ¶
func (sr *StateRoot) Serialize(bw *io.BinaryWriter)
func (*StateRoot) SerializeUnsigned ¶
func (sr *StateRoot) SerializeUnsigned(bw *io.BinaryWriter)
func (*StateRoot) SetWitnesses ¶ added in v0.3.3
type ToMerkleValue ¶ added in v1.2.0
type ToMerkleValue struct { TxHash []byte // poly chain tx hash FromChainID uint64 TxParam *CrossChainTxParameter }
func DeserializeMerkleValue ¶ added in v1.2.0
func DeserializeMerkleValue(source []byte) (*ToMerkleValue, error)
Click to show internal directories.
Click to hide internal directories.