tx

package
v0.0.0-...-1c03811 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	Clause []*Clause
}

Body contains the body information for a transaction TODO: support more than one clause

type Builder

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

Builder to make it easy to build transaction. TODO: clause should support array

func (*Builder) Build

func (b *Builder) Build() *Transaction

Build build tx object

func (*Builder) Clause

func (b *Builder) Clause(c *Clause) *Builder

Clause appends a clause

func (*Builder) Nonce

func (b *Builder) Nonce(nonce uint64) *Builder

Nonce set nonce

type Clause

type Clause struct {
	Recipient *common.Address
	Amount    *big.Int
	Data      []byte
}

Clause contains information of a cluase

func NewClause

func NewClause(to *common.Address) *Clause

NewClause create a new clause instance.

type Header struct {
	Nonce uint64
}

Header contains the header information for a transaction

type Transaction

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

Transaction contains one transaction and it's information.

func (*Transaction) Body

func (tx *Transaction) Body() *Body

Body returns the block body.

func (*Transaction) Clause

func (tx *Transaction) Clause() []*Clause

Clause returns a clause

func (*Transaction) Header

func (tx *Transaction) Header() *Header

Header returns the block header.

func (*Transaction) ID

func (tx *Transaction) ID() (h common.Hash)

ID returns the transaction hash of the header, which is simply the keccak256 hash of its RLP Encoding TODO: implement more complex architecture of having RLP Hash seperate from ID

func (*Transaction) Nonce

func (tx *Transaction) Nonce() uint64

Nonce returns nonce value.

type Transactions

type Transactions []*Transaction

Transactions an array of transaction

Jump to

Keyboard shortcuts

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