types

package
v0.0.0-...-868bdbc Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OpcodeChildBlockMessage           = opcode.Opcode(1111)
	OpcodeConnectionMessage           = opcode.Opcode(1112)
	OpcodeBlockHeightRequest          = opcode.Opcode(1113)
	OpcodeBlockResponse               = opcode.Opcode(1114)
	OpcodeAccountRequest              = opcode.Opcode(1115)
	OpcodeAccountResponse             = opcode.Opcode(1116)
	OpcodeTxRequest                   = opcode.Opcode(1117)
	OpcodeTxResponse                  = opcode.Opcode(1118)
	OpcodeTxDetailRequest             = opcode.Opcode(1119)
	OpcodeTxDetailResponse            = opcode.Opcode(1120)
	OpcodeTxsByAddressRequest         = opcode.Opcode(1121)
	OpcodeTxsResponse                 = opcode.Opcode(1122)
	OpcodeTxsByAssetAndAddressRequest = opcode.Opcode(1123)
	OpcodeTxUpdateRequest             = opcode.Opcode(1124)
	OpcodeTxUpdateResponse            = opcode.Opcode(1125)
	OpcodeTxDeleteRequest             = opcode.Opcode(1126)
	OpcodeTxLockedRequest             = opcode.Opcode(1127)
	OpcodeTxLockedResponse            = opcode.Opcode(1128)
	OpcodePing                        = opcode.Opcode(1129)
	OpcodePong                        = opcode.Opcode(1130)
	OpcodeTxRedeemRequest             = opcode.Opcode(1131)
	OpcodeTxRedeemResponse            = opcode.Opcode(1132)
	OpcodeTxsByBlockHeightRequest     = opcode.Opcode(1133)
	OpcodeLastBlockRequest            = opcode.Opcode(1134)
)

Opcode definitions

Variables

This section is empty.

Functions

func ComputeAminoOverhead

func ComputeAminoOverhead(tx Tx, fieldNum int) int64

func GetCodec

func GetCodec() *amino.Codec

GetCodec returns a codec used by the package. For testing purposes only.

func RegisterBlockAmino

func RegisterBlockAmino(cdc *amino.Codec)

Types

type Tx

type Tx []byte

Tx is an arbitrary byte array.

func (Tx) Hash

func (tx Tx) Hash() []byte

Hash computes the HERHASH hash of the encoded transaction.

func (Tx) String

func (tx Tx) String() string

String returns the hex-encoded transaction as a string.

type TxProof

type TxProof struct {
	RootHash cmn.HexBytes
	Data     Tx
	Proof    merkle.SimpleProof
}

TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.

func (TxProof) LeafHash

func (tp TxProof) LeafHash() []byte

LeafHash returns the hash of the this proof refers to.

func (TxProof) Validate

func (tp TxProof) Validate(dataHash []byte) error

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.

type Txs

type Txs []Tx

Txs is a slice of Tx.

func (Txs) Hash

func (txs Txs) Hash() []byte

Hash returns the simple Merkle root hash of the transactions.

func (Txs) Index

func (txs Txs) Index(tx Tx) int

Index returns the index of this transaction in the list, or -1 if not found

func (Txs) IndexByHash

func (txs Txs) IndexByHash(hash []byte) int

IndexByHash returns the index of this transaction hash in the list, or -1 if not found

func (Txs) Proof

func (txs Txs) Proof(i int) TxProof

Proof returns a simple merkle proof for this node. Panics if i < 0 or i >= len(txs) TODO: This needs to be optimized

Jump to

Keyboard shortcuts

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