Documentation ¶
Index ¶
- func RegisterTxServiceAmino(cdc *amino.Codec)
- func VerifySignature(tx *protobuf.Tx, pubKey secp256k1.PubKeySecp256k1) (bool, error)
- type Proof
- type Service
- type Tx
- type Txs
- func (t *Txs) GetTxs() [][]byte
- func (t *Txs) Hash(tx Tx) []byte
- func (t *Txs) Index(tx Tx) int
- func (t *Txs) IndexByHash(hash []byte) int
- func (t *Txs) LeafHash(tx Tx) []byte
- func (t *Txs) MerkleHash() []byte
- func (t *Txs) ParseNewTxRequest(senderNonce, senderBal uint64, txReq *txProtoc.TransactionRequest) error
- func (t *Txs) Proof(i int) Proof
- func (t *Txs) SetTxs(txs [][]byte)
- func (t *Txs) String(tx Tx) string
- func (t *Txs) Validate(dataHash []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTxServiceAmino ¶
RegisterTxServiceAmino ...
func VerifySignature ¶
Types ¶
type Proof ¶
type Proof struct { RootHash cmn.HexBytes Data Tx Proof merkle.SimpleProof }
Proof represents a Merkle proof of the presence of a transaction in the Merkle tree.
type Service ¶
type Service interface { SetTxs(txs [][]byte) GetTxs() [][]byte ParseNewTxRequest(uint64, uint64, *txProtoc.TransactionRequest) error // Accepts incoming protoc structured transactions and sets byte-wise tx transaction Hash(tx Tx) []byte // Hash computes the hash of the wire encoded transaction. String(tx Tx) string // String returns the hex-encoded transaction as a string. Index(tx Tx) int // Index returns the index of this transaction in the list, or -1 if not found IndexByHash(hash []byte) int // IndexByHash returns the index of this transaction hash in the list, or -1 if not found MerkleHash() []byte // MerkleHash returns the simple Merkle root hash of the transactions. Proof(i int) Proof // Proof returns a simple merkle proof for this node. LeafHash(tx Tx) []byte // LeafHash returns the hash of the this proof refers to. // Validate verifies the proof. It returns nil if the RootHash matches the dataHash argument, // and if the proof is internally consistent. Otherwise, it returns a sensible error. Validate(dataHash []byte) error }
Service ... Operations for a list of transactions
type Txs ¶
type Txs [][]byte
Txs is a slice of Tx. TODO make Txs of type `[]Tx`
func (*Txs) IndexByHash ¶
IndexByHash returns the index of this transaction hash in the list, or -1 if not found
func (*Txs) MerkleHash ¶
MerkleHash returns the simple Merkle root hash of the transactions.
func (*Txs) ParseNewTxRequest ¶
func (t *Txs) ParseNewTxRequest(senderNonce, senderBal uint64, txReq *txProtoc.TransactionRequest) error
func (*Txs) Proof ¶
Proof returns a simple merkle proof for this node. Panics if i < 0 or i >= len(txs) TODO: optimize this!
Click to show internal directories.
Click to hide internal directories.