Versions in this module Expand all Collapse all v1 v1.2.2 Apr 7, 2024 Changes in this version + func ByteToFloat64(bytes []byte) float64 + func BytesToHash(b []byte) common.Hash + func GetNodeFromLeaf(ln uint64) uint64 + func HashToF64(x common.Hash) float64 + func IsPowerOfTwo(n uint64) bool + func MapVerify(proof []byte, txHash common.Hash) error + func NextPowerOfTwo(n uint64) uint64 + func ProofInfoToBytes(info *ProofInfo) ([]byte, error) + func RlpHash(x interface{}) (h common.Hash) + func SortAndRemoveRepeatForBlocks(slc []uint64) []uint64 + func Uint64ToBytes(i uint64) []byte + type ChainAdapter struct + ConfirmBlock *types.Header + Genesis common.Hash + Latest []*types.Header + ProofHeader *types.Header + func (o *ChainAdapter) Copy() *ChainAdapter + func (o *ChainAdapter) GenesisCheck(head *types.Header) error + type ChainHeaderProof struct + Header []*types.Header + Proof *ProofInfo + Right *big.Int + func (b *ChainHeaderProof) Data() ([]byte, error) + type ChainInfoProof struct + Header []*types.Header + Proof *ProofInfo + type ChainProofs struct + HeaderProof *ChainHeaderProof + InfoProof *ChainInfoProof + Remote *ChainAdapter + func NewChainProofs() *ChainProofs + func (cps *ChainProofs) Data() ([]byte, error) + func (cps *ChainProofs) Verify() error + type MapProofs struct + ChainProof *ChainProofs + End *big.Int + Header *types.Header + ReceiptProof *ReceiptProof + Result bool + TxHash common.Hash + func (mr *MapProofs) VerifyMapTransaction(txHash common.Hash) (*types.Receipt, error) + type MapTransaction struct + SimpUlvpP *MapProofs + Tx *types.Transaction + type Mmr struct + func NewMMR() *Mmr + func (m *Mmr) Copy() *Mmr + func (m *Mmr) CreateNewProof(right_difficulty *big.Int) (*ProofInfo, []uint64, []uint64) + func (m *Mmr) GenerateProof(proofHeight, EndHeight uint64) *ProofInfo + func (m *Mmr) GenerateProof2(proofHeight, EndHeight uint64) *ProofInfo + func (m *Mmr) GetRoot2() common.Hash + func (m *Mmr) Pop2() *Node + func (m *Mmr) Push(newElem *Node) + type Node struct + func NewNode(v common.Hash, d, ds, de *big.Int, timeCost uint64) *Node + func (n *Node) GetHash() common.Hash + func (n *Node) String() string + type NodeList []rlp.RawValue + func (n *NodeList) Delete(key []byte) error + func (n *NodeList) Put(key []byte, value []byte) error + func (n NodeList) DataSize() int + func (n NodeList) NodeSet() *NodeSet + func (n NodeList) Store(db ethdb.KeyValueWriter) + type NodeSet struct + func NewNodeSet() *NodeSet + func (db *NodeSet) DataSize() int + func (db *NodeSet) Delete(key []byte) error + func (db *NodeSet) Get(key []byte) ([]byte, error) + func (db *NodeSet) Has(key []byte) (bool, error) + func (db *NodeSet) KeyCount() int + func (db *NodeSet) NodeList() NodeList + func (db *NodeSet) Put(key []byte, value []byte) error + func (db *NodeSet) Store(target ethdb.KeyValueWriter) + type ProofBlock struct + AggrWeight float64 + Number uint64 + func SortAndRemoveRepeatForProofBlocks(slc []*ProofBlock) []*ProofBlock + func VerifyRequiredBlocks(info *ProofInfo, right_difficulty *big.Int) ([]*ProofBlock, error) + func VerifyRequiredBlocks2(info *ProofInfo) ([]*ProofBlock, error) + type ProofBlocks []*ProofBlock + func (a ProofBlocks) Len() int + func (a ProofBlocks) Less(i, j int) bool + func (a ProofBlocks) Swap(i, j int) + type ProofElem struct + Cat uint8 + LeafNum uint64 + Res *ProofRes + Right bool + func (p *ProofElem) String() string + type ProofElems []*ProofElem + type ProofInfo struct + Checked []uint64 + Elems []*ProofElem + LeafNumber uint64 + RootDifficulty *big.Int + RootHash common.Hash + func ProofInfoFromBytes(data []byte) (*ProofInfo, error) + func (p *ProofInfo) String() string + func (p *ProofInfo) VerifyProof(blocks []*ProofBlock) bool + func (p *ProofInfo) VerifyProof2(blocks []*ProofBlock) bool + type ProofRes struct + H common.Hash + TD *big.Int + func (r *ProofRes) String() string + type ReceiptProof struct + Index uint64 + Proofs NodeList + ReceiptHash common.Hash + func (r *ReceiptProof) Verify() (*types.Receipt, error) + type VerifyElem struct + Index uint64 + LeafNumber uint64 + Res *ProofRes + type VerifyElems []*VerifyElem