transaction

package
v1.0.64 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: GPL-3.0 Imports: 6 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 or SC call

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 TrimSlicePtr

func TrimSlicePtr(in []*Transaction) []*Transaction

TrimSlicePtr creates a copy of the provided slice without the excess capacity

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 gas limit of the transaction

func (*Transaction) GetGasPrice

func (tx *Transaction) GetGasPrice() uint64

GetGasPrice returns the gas price of the transaction

func (*Transaction) GetNonce

func (tx *Transaction) GetNonce() uint64

GetNonce returns the transaction nonce

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) MarshalJSON

func (tx *Transaction) MarshalJSON() ([]byte, error)

MarshalJSON converts the Transaction data type into its corresponding equivalent in byte slice. Note that Value data type is converted in a string

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

func (*Transaction) UnmarshalJSON

func (tx *Transaction) UnmarshalJSON(dataBuff []byte) error

UnmarshalJSON converts the provided bytes into a Transaction data type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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