Documentation ¶
Index ¶
- func TransactionGoToCapn(seg *capn.Segment, src *Transaction) capnp.TransactionCapn
- type Transaction
- func (tx *Transaction) GetData() []byte
- func (tx *Transaction) GetRecvAddress() []byte
- func (tx *Transaction) GetSndAddress() []byte
- func (tx *Transaction) GetValue() *big.Int
- func (tx *Transaction) IsInterfaceNil() bool
- func (tx *Transaction) Load(r io.Reader) error
- func (tx *Transaction) Save(w io.Writer) 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)
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 []byte `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() []byte
GetData returns the data of 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 []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