transaction

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MethodPriorityNormal is the normal method priority.
	MethodPriorityNormal = 0
	// MethodPriorityCritical is the priority for methods critical to the protocol operation.
	MethodPriorityCritical = 255
)
View Source
const MethodSeparator = "."

MethodSeparator is the separator used to separate backend name from method name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Costs

type Costs map[Op]Gas

Costs defines gas costs for different operations.

type Fee

type Fee struct {
	// Amount is the fee amount to be paid.
	Amount quantity.Quantity `json:"amount"`
	// Gas is the maximum gas that a transaction can use.
	Gas Gas `json:"gas"`
}

Fee is the consensus transaction fee the sender wishes to pay for operations which require a fee to be paid to validators.

type Gas

type Gas uint64

Gas is the consensus gas representation.

type MethodMetadata

type MethodMetadata struct {
	Priority MethodPriority
}

MethodMetadata is the method metadata.

type MethodName

type MethodName string

MethodName is a method name.

type MethodPriority

type MethodPriority uint8

MethodPriority is the method handling priority.

type Op

type Op string

Op identifies an operation that requires gas to run.

type PrettyTransaction

type PrettyTransaction struct {
	Nonce  uint64      `json:"nonce"`
	Fee    *Fee        `json:"fee,omitempty"`
	Method MethodName  `json:"method"`
	Body   interface{} `json:"body,omitempty"`
}

PrettyTransaction is used for pretty-printing transactions so that the actual content is displayed instead of the binary blob.

It should only be used for pretty printing.

type Proof

type Proof struct {
	// Height is the block height at which the transaction was published.
	Height int64 `json:"height"`

	// RawProof is the actual raw proof.
	RawProof []byte `json:"raw_proof"`
}

Proof is a proof of transaction inclusion in a block.

type SignedTransaction

type SignedTransaction struct {
	signature.Signed
}

SignedTransaction is a signed consensus transaction.

func (*SignedTransaction) Hash

func (s *SignedTransaction) Hash() hash.Hash

Hash returns the cryptographic hash of the encoded transaction.

type Transaction

type Transaction struct {
	// Nonce is a nonce to prevent replay.
	Nonce uint64 `json:"nonce"`
	// Fee is an optional fee that the sender commits to pay to execute this
	// transaction.
	Fee *Fee `json:"fee,omitempty"`

	// Method is the method that should be called.
	Method MethodName `json:"method"`
	// Body is the method call body.
	Body cbor.RawMessage `json:"body,omitempty"`
}

Transaction is an unsigned consensus transaction.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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