Documentation ¶
Index ¶
- func TrimSliceHandler(in []data.TransactionHandler) []data.TransactionHandler
- type Transaction
- func (tx *Transaction) GetData() []byte
- func (tx *Transaction) GetGasLimit() uint64
- func (tx *Transaction) GetGasPrice() uint64
- func (tx *Transaction) GetNonce() uint64
- func (tx *Transaction) GetRecvAddress() []byte
- func (tx *Transaction) GetSndAddress() []byte
- func (tx *Transaction) GetValue() *big.Int
- func (tx *Transaction) IsInterfaceNil() bool
- func (tx *Transaction) MarshalJSON() ([]byte, error)
- func (tx *Transaction) SetData(data []byte)
- func (tx *Transaction) SetRecvAddress(addr []byte)
- func (tx *Transaction) SetSndAddress(addr []byte)
- func (tx *Transaction) SetValue(value *big.Int)
- func (tx *Transaction) UnmarshalJSON(dataBuff []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrimSliceHandler ¶
func TrimSliceHandler(in []data.TransactionHandler) []data.TransactionHandler
TrimSliceHandler creates a copy of the provided slice without the excess capacity
Types ¶
type Transaction ¶
type Transaction struct { Nonce uint64 `json:"nonce"` Value *big.Int `json:"value"` RcvAddr []byte `json:"receiver"` SndAddr []byte `json:"sender"` GasPrice uint64 `json:"gasPrice,omitempty"` GasLimit uint64 `json:"gasLimit,omitempty"` Data []byte `json:"data,omitempty"` Signature []byte `json:"signature,omitempty"` }
Transaction holds all the data needed for a value transfer or SC call
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() []byte
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) 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) SetData ¶
func (tx *Transaction) SetData(data []byte)
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.