proofsignature

package
v0.4.6-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetArguments

func GetArguments(req hexutil.Bytes) (map[string]interface{}, error)

func ToHex

func ToHex(v interface{}) (hexutil.Bytes, error)

Types

type DagDB

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

DagDB is an in-memory database backend using a B-tree for storage.

For performance reasons, all given and returned keys and values are pointers to the in-memory database, so modifying them will cause the stored values to be modified as well. All DB methods already specify that keys and values should be considered read-only, but this is especially important with DagDB.

func NewDagDB

func NewDagDB(s *anconsync.Storage) *DagDB

NewDagDB creates a new in-memory database.

func (*DagDB) Close

func (db *DagDB) Close() error

Close implements DB.

func (*DagDB) Delete

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

Delete implements DB.

func (*DagDB) DeleteSync

func (db *DagDB) DeleteSync(key []byte) error

DeleteSync implements DB.

func (*DagDB) Get

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

Get implements DB.

func (*DagDB) Has

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

Has implements DB.

func (*DagDB) Iterator

func (db *DagDB) Iterator(start, end []byte) (dbm.Iterator, error)

dbm.Iterator implements DB. Takes out a read-lock on the database until the iterator is closed.

func (*DagDB) IteratorNoMtx

func (db *DagDB) IteratorNoMtx(start, end []byte) (dbm.Iterator, error)

IteratorNoMtx makes an iterator with no mutex.

func (*DagDB) NewBatch

func (db *DagDB) NewBatch() dbm.Batch

NewBatch implements DB.

func (*DagDB) Print

func (db *DagDB) Print() error

Print implements DB.

func (*DagDB) ReverseIterator

func (db *DagDB) ReverseIterator(start, end []byte) (dbm.Iterator, error)

ReverseIterator implements DB. Takes out a read-lock on the database until the iterator is closed.

func (*DagDB) ReverseIteratorNoMtx

func (db *DagDB) ReverseIteratorNoMtx(start, end []byte) (dbm.Iterator, error)

ReverseIteratorNoMtx makes an iterator with no mutex.

func (*DagDB) Set

func (db *DagDB) Set(key []byte, value []byte) error

Set implements DB.

func (*DagDB) SetSync

func (db *DagDB) SetSync(key []byte, value []byte) error

SetSync implements DB.

func (*DagDB) Stats

func (db *DagDB) Stats() map[string]string

Stats implements DB.

type IavlProofAPI

type IavlProofAPI struct {
	Namespace string
	Version   string
	Service   *IavlProofService
	Public    bool
}

func NewIavlAPI

func NewIavlAPI(dagStore anconsync.Storage, dagExchange graphsync.GraphExchange, db dbm.DB, cacheSize, version int64) (*IavlProofAPI, error)

type IavlProofService

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

func (*IavlProofService) Get

func (s *IavlProofService) Get(key []byte) (hexutil.Bytes, error)

Get returns a result containing the index and value for a given key based on the current state (version) of the tree. If the key does not exist, Get returns the index of the next value.

func (*IavlProofService) GetByIndex

func (s *IavlProofService) GetByIndex(index int64) (hexutil.Bytes, error)

GetByIndex returns a result containing the key and value for a given index based on the current state (version) of the tree.

func (*IavlProofService) GetVersioned

func (s *IavlProofService) GetVersioned(version int64, key []byte) (hexutil.Bytes, error)

GetVersioned returns a result containing the IAVL tree version and value for a given key at a specific tree version.

func (*IavlProofService) GetWithProof

func (s *IavlProofService) GetWithProof(key []byte) (hexutil.Bytes, error)

GetWithProof returns a result containing the IAVL tree version and value for a given key based on the current state (version) of the tree including a verifiable Merkle proof.

func (*IavlProofService) Has

func (s *IavlProofService) Has(key []byte) (hexutil.Bytes, error)

Has returns a result containing a boolean on whether or not the IAVL tree has a given key in the current version

func (*IavlProofService) HasVersioned

func (s *IavlProofService) HasVersioned(version int64) (hexutil.Bytes, error)

HasVersioned returns a result containing a boolean on whether or not the IAVL tree has a given key at a specific tree version.

func (*IavlProofService) Hash

func (s *IavlProofService) Hash(_ *empty.Empty) (hexutil.Bytes, error)

Hash returns the IAVL tree root hash based on the current state.

func (*IavlProofService) Set

func (s *IavlProofService) Set(key []byte, value []byte) (hexutil.Bytes, error)

Set returns a result after inserting a key/value pair into the IAVL tree based on the current state (version) of the tree.

Jump to

Keyboard shortcuts

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