txtrie

package
v0.0.0-...-8026f46 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2020 ChainSafe Systems SPDX-License-Identifier: LGPL-3.0-only

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTransactions1

func GetTransactions1() types.Transactions

func GetTransactions2

func GetTransactions2() types.Transactions

func GetTransactions3

func GetTransactions3() types.Transactions

func VerifyProof

func VerifyProof(root common.Hash, key []byte, proof *ProofDatabase) (bool, error)

VerifyProof verifies merkle proof on path key against the provided root

Types

type ProofDatabase

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

func NewProofDatabase

func NewProofDatabase() *ProofDatabase

NewProofDatabase returns a wrapped map

func (*ProofDatabase) Close

func (db *ProofDatabase) Close() error

Close sets ProofDatabase db's db to nil

func (*ProofDatabase) Delete

func (db *ProofDatabase) Delete(key []byte) error

Delete removes the key and associated value from the database

func (*ProofDatabase) Get

func (db *ProofDatabase) Get(key []byte) ([]byte, error)

Get retrieves value associated with key in ProofDatabase db, and checks for existance

func (*ProofDatabase) Has

func (db *ProofDatabase) Has(key []byte) (bool, error)

Has checks if key exists in ProofDatabase db

func (*ProofDatabase) Put

func (db *ProofDatabase) Put(key []byte, value []byte) error

Put insets and associates value with key in ProofDatabase db

type TxTries

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

TxTries stores all the instances of tries we have on disk

func NewTxTries

func NewTxTries() *TxTries

NewTxTries creates a new instance of a TxTries object

func (*TxTries) CreateNewTrie

func (t *TxTries) CreateNewTrie(root common.Hash, transactions types.Transactions) error

AddNewTrie adds a new transaction trie to an existing TxTries object

func (*TxTries) RetrieveEncodedProof

func (t *TxTries) RetrieveEncodedProof(root common.Hash, key []byte) ([]byte, error)

RetrieveEncodedProof retrieves an encoded Proof for a value at key in trie with root root

func (*TxTries) RetrieveProof

func (t *TxTries) RetrieveProof(root common.Hash, key []byte) (*ProofDatabase, error)

RetrieveProof retrieves a Proof for a value at key in trie with root root

Jump to

Keyboard shortcuts

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