transaction

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransactionGoToCapn added in v1.0.3

func TransactionGoToCapn(seg *capn.Segment, src *Transaction) capnp.TransactionCapn

TransactionGoToCapn is a helper function to copy fields from a Transaction object to a TransactionCapn object

Types

type Transaction

type Transaction struct {
	Nonce     uint64   `capid:"0" json:"nonce"`
	Value     *big.Int `capid:"1" json:"value"`
	RcvAddr   []byte   `capid:"2" json:"receiver"`
	SndAddr   []byte   `capid:"3" json:"sender"`
	GasPrice  uint64   `capid:"4" json:"gasPrice,omitempty"`
	GasLimit  uint64   `capid:"5" json:"gasLimit,omitempty"`
	Data      string   `capid:"6" json:"data,omitempty"`
	Signature []byte   `capid:"7" json:"signature,omitempty"`
	Challenge []byte   `capid:"8" json:"challenge,omitempty"`
}

Transaction holds all the data needed for a value transfer

func TransactionCapnToGo added in v1.0.3

func TransactionCapnToGo(src capnp.TransactionCapn, dest *Transaction) *Transaction

TransactionCapnToGo is a helper function to copy fields from a TransactionCapn object to a Transaction object

func (*Transaction) GetData

func (tx *Transaction) GetData() string

GetData returns the data of the transaction

func (*Transaction) GetGasLimit

func (tx *Transaction) GetGasLimit() uint64

GetGasLimit returns the provided gas limit in the transaction

func (*Transaction) GetGasPrice

func (tx *Transaction) GetGasPrice() uint64

GetGasPrice returns the provided gas price in the transaction

func (*Transaction) GetRecvAddress added in v1.0.3

func (tx *Transaction) GetRecvAddress() []byte

GetRecvAddress returns the receiver address from the transaction

func (*Transaction) GetSndAddress added in v1.0.3

func (tx *Transaction) GetSndAddress() []byte

GetSndAddress returns the sender address from the transaction

func (*Transaction) GetValue

func (tx *Transaction) GetValue() *big.Int

GetValue returns the value of the transaction

func (*Transaction) IsInterfaceNil

func (tx *Transaction) IsInterfaceNil() bool

IsInterfaceNil verifies if underlying object is nil

func (*Transaction) Load added in v1.0.3

func (tx *Transaction) Load(r io.Reader) error

Load loads the data from the stream into a Transaction object through Capnp protocol

func (*Transaction) Save added in v1.0.3

func (tx *Transaction) Save(w io.Writer) error

Save saves the serialized data of a Transaction into a stream through Capnp protocol

func (*Transaction) SetData

func (tx *Transaction) SetData(data string)

SetData sets the data of the transaction

func (*Transaction) SetRecvAddress added in v1.0.3

func (tx *Transaction) SetRecvAddress(addr []byte)

SetRecvAddress sets the receiver address of the transaction

func (*Transaction) SetSndAddress added in v1.0.3

func (tx *Transaction) SetSndAddress(addr []byte)

SetSndAddress sets the sender address of the transaction

func (*Transaction) SetValue

func (tx *Transaction) SetValue(value *big.Int)

SetValue sets the value of the transaction

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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