Documentation ¶
Index ¶
- Variables
- func SignTxContent(tx *Tx, account *account.Account) (*crypto.Signature, error)
- type Action
- type ActionRaw
- func (*ActionRaw) Descriptor() ([]byte, []int)
- func (m *ActionRaw) GetActionName() string
- func (m *ActionRaw) GetContract() string
- func (m *ActionRaw) GetData() string
- func (m *ActionRaw) Marshal() (dAtA []byte, err error)
- func (m *ActionRaw) MarshalTo(dAtA []byte) (int, error)
- func (*ActionRaw) ProtoMessage()
- func (m *ActionRaw) Reset()
- func (m *ActionRaw) Size() (n int)
- func (m *ActionRaw) String() string
- func (m *ActionRaw) Unmarshal(dAtA []byte) error
- func (m *ActionRaw) XXX_DiscardUnknown()
- func (m *ActionRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ActionRaw) XXX_Merge(src proto.Message)
- func (m *ActionRaw) XXX_Size() int
- func (m *ActionRaw) XXX_Unmarshal(b []byte) error
- type Receipt
- type ReceiptRaw
- func (*ReceiptRaw) Descriptor() ([]byte, []int)
- func (m *ReceiptRaw) GetContent() string
- func (m *ReceiptRaw) GetType() int32
- func (m *ReceiptRaw) Marshal() (dAtA []byte, err error)
- func (m *ReceiptRaw) MarshalTo(dAtA []byte) (int, error)
- func (*ReceiptRaw) ProtoMessage()
- func (m *ReceiptRaw) Reset()
- func (m *ReceiptRaw) Size() (n int)
- func (m *ReceiptRaw) String() string
- func (m *ReceiptRaw) Unmarshal(dAtA []byte) error
- func (m *ReceiptRaw) XXX_DiscardUnknown()
- func (m *ReceiptRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ReceiptRaw) XXX_Merge(src proto.Message)
- func (m *ReceiptRaw) XXX_Size() int
- func (m *ReceiptRaw) XXX_Unmarshal(b []byte) error
- type ReceiptType
- type Status
- type StatusCode
- type StatusRaw
- func (*StatusRaw) Descriptor() ([]byte, []int)
- func (m *StatusRaw) GetCode() int32
- func (m *StatusRaw) GetMessage() string
- func (m *StatusRaw) Marshal() (dAtA []byte, err error)
- func (m *StatusRaw) MarshalTo(dAtA []byte) (int, error)
- func (*StatusRaw) ProtoMessage()
- func (m *StatusRaw) Reset()
- func (m *StatusRaw) Size() (n int)
- func (m *StatusRaw) String() string
- func (m *StatusRaw) Unmarshal(dAtA []byte) error
- func (m *StatusRaw) XXX_DiscardUnknown()
- func (m *StatusRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *StatusRaw) XXX_Merge(src proto.Message)
- func (m *StatusRaw) XXX_Size() int
- func (m *StatusRaw) XXX_Unmarshal(b []byte) error
- type Tx
- type TxRaw
- func (*TxRaw) Descriptor() ([]byte, []int)
- func (m *TxRaw) GetActions() []*ActionRaw
- func (m *TxRaw) GetExpiration() int64
- func (m *TxRaw) GetGasLimit() int64
- func (m *TxRaw) GetGasPrice() int64
- func (m *TxRaw) GetPublisher() *crypto.SignatureRaw
- func (m *TxRaw) GetSigners() [][]byte
- func (m *TxRaw) GetSigns() []*crypto.SignatureRaw
- func (m *TxRaw) GetTime() int64
- func (m *TxRaw) Marshal() (dAtA []byte, err error)
- func (m *TxRaw) MarshalTo(dAtA []byte) (int, error)
- func (*TxRaw) ProtoMessage()
- func (m *TxRaw) Reset()
- func (m *TxRaw) Size() (n int)
- func (m *TxRaw) String() string
- func (m *TxRaw) Unmarshal(dAtA []byte) error
- func (m *TxRaw) XXX_DiscardUnknown()
- func (m *TxRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TxRaw) XXX_Merge(src proto.Message)
- func (m *TxRaw) XXX_Size() int
- func (m *TxRaw) XXX_Unmarshal(b []byte) error
- type TxReceipt
- type TxReceiptRaw
- func (*TxReceiptRaw) Descriptor() ([]byte, []int)
- func (m *TxReceiptRaw) GetGasUsage() int64
- func (m *TxReceiptRaw) GetReceipts() []*ReceiptRaw
- func (m *TxReceiptRaw) GetStatus() *StatusRaw
- func (m *TxReceiptRaw) GetSuccActionNum() int32
- func (m *TxReceiptRaw) GetTxHash() []byte
- func (m *TxReceiptRaw) Marshal() (dAtA []byte, err error)
- func (m *TxReceiptRaw) MarshalTo(dAtA []byte) (int, error)
- func (*TxReceiptRaw) ProtoMessage()
- func (m *TxReceiptRaw) Reset()
- func (m *TxReceiptRaw) Size() (n int)
- func (m *TxReceiptRaw) String() string
- func (m *TxReceiptRaw) Unmarshal(dAtA []byte) error
- func (m *TxReceiptRaw) XXX_DiscardUnknown()
- func (m *TxReceiptRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TxReceiptRaw) XXX_Merge(src proto.Message)
- func (m *TxReceiptRaw) XXX_Size() int
- func (m *TxReceiptRaw) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") )
Functions ¶
Types ¶
type Action ¶
type Action struct { Contract string // contract name ActionName string // method name of contract Data string // parameters of method, with json format }
Action implement
type ActionRaw ¶
type ActionRaw struct { Contract string `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"` ActionName string `protobuf:"bytes,2,opt,name=actionName,proto3" json:"actionName,omitempty"` Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ActionRaw) Descriptor ¶
func (*ActionRaw) GetActionName ¶
func (*ActionRaw) GetContract ¶
func (*ActionRaw) ProtoMessage ¶
func (*ActionRaw) ProtoMessage()
func (*ActionRaw) XXX_DiscardUnknown ¶
func (m *ActionRaw) XXX_DiscardUnknown()
func (*ActionRaw) XXX_Marshal ¶
func (*ActionRaw) XXX_Unmarshal ¶
type Receipt ¶
type Receipt struct { Type ReceiptType // system defined or user defined receipt type Content string // can be a raw string or a json string }
Receipt generated when applying transaction
type ReceiptRaw ¶
type ReceiptRaw struct { Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ReceiptRaw) Descriptor ¶
func (*ReceiptRaw) Descriptor() ([]byte, []int)
func (*ReceiptRaw) GetContent ¶
func (m *ReceiptRaw) GetContent() string
func (*ReceiptRaw) GetType ¶
func (m *ReceiptRaw) GetType() int32
func (*ReceiptRaw) Marshal ¶
func (m *ReceiptRaw) Marshal() (dAtA []byte, err error)
func (*ReceiptRaw) ProtoMessage ¶
func (*ReceiptRaw) ProtoMessage()
func (*ReceiptRaw) Reset ¶
func (m *ReceiptRaw) Reset()
func (*ReceiptRaw) Size ¶
func (m *ReceiptRaw) Size() (n int)
func (*ReceiptRaw) String ¶
func (m *ReceiptRaw) String() string
func (*ReceiptRaw) Unmarshal ¶
func (m *ReceiptRaw) Unmarshal(dAtA []byte) error
func (*ReceiptRaw) XXX_DiscardUnknown ¶
func (m *ReceiptRaw) XXX_DiscardUnknown()
func (*ReceiptRaw) XXX_Marshal ¶
func (m *ReceiptRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ReceiptRaw) XXX_Merge ¶
func (dst *ReceiptRaw) XXX_Merge(src proto.Message)
func (*ReceiptRaw) XXX_Size ¶
func (m *ReceiptRaw) XXX_Size() int
func (*ReceiptRaw) XXX_Unmarshal ¶
func (m *ReceiptRaw) XXX_Unmarshal(b []byte) error
type ReceiptType ¶
type ReceiptType int32
ReceiptType type of single receipt
const ( // SystemDefined system receipt, recording info of calling a method SystemDefined ReceiptType = iota // UserDefined user defined receipt, usually a json string UserDefined )
type Status ¶
type Status struct { Code StatusCode Message string }
Status status of transaction execution result, including code and message
type StatusCode ¶
type StatusCode int32
StatusCode status code of transaction execution result
const ( Success StatusCode = iota ErrorGasRunOut ErrorBalanceNotEnough ErrorParamter // parameter mismatch when calling function ErrorRuntime // runtime error ErrorTimeout ErrorTxFormat // tx format errors ErrorDuplicateSetCode // more than one set code action in a tx ErrorUnknown // other errors )
tx execution result
type StatusRaw ¶
type StatusRaw struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StatusRaw) Descriptor ¶
func (*StatusRaw) GetMessage ¶
func (*StatusRaw) ProtoMessage ¶
func (*StatusRaw) ProtoMessage()
func (*StatusRaw) XXX_DiscardUnknown ¶
func (m *StatusRaw) XXX_DiscardUnknown()
func (*StatusRaw) XXX_Marshal ¶
func (*StatusRaw) XXX_Unmarshal ¶
type Tx ¶
type Tx struct { Time int64 `json:"time,string"` Expiration int64 `json:"expiration,string"` GasLimit int64 `json:"gas_limit,string"` Actions []*Action `json:"-"` Signers [][]byte `json:"-"` Signs []*crypto.Signature `json:"-"` Publisher *crypto.Signature `json:"-"` GasPrice int64 `json:"gas_price,string"` // contains filtered or unexported fields }
Tx Transaction structure
func NewTx ¶
func NewTx(actions []*Action, signers [][]byte, gasLimit int64, gasPrice int64, expiration int64) *Tx
NewTx return a new Tx
type TxRaw ¶
type TxRaw struct { Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` Expiration int64 `protobuf:"varint,2,opt,name=expiration,proto3" json:"expiration,omitempty"` GasLimit int64 `protobuf:"varint,3,opt,name=gasLimit,proto3" json:"gasLimit,omitempty"` GasPrice int64 `protobuf:"varint,4,opt,name=gasPrice,proto3" json:"gasPrice,omitempty"` Actions []*ActionRaw `protobuf:"bytes,5,rep,name=actions" json:"actions,omitempty"` Signers [][]byte `protobuf:"bytes,6,rep,name=signers" json:"signers,omitempty"` Signs []*crypto.SignatureRaw `protobuf:"bytes,7,rep,name=signs" json:"signs,omitempty"` Publisher *crypto.SignatureRaw `protobuf:"bytes,8,opt,name=publisher" json:"publisher,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TxRaw) Descriptor ¶
func (*TxRaw) GetActions ¶
func (*TxRaw) GetExpiration ¶
func (*TxRaw) GetGasLimit ¶
func (*TxRaw) GetGasPrice ¶
func (*TxRaw) GetPublisher ¶
func (m *TxRaw) GetPublisher() *crypto.SignatureRaw
func (*TxRaw) GetSigners ¶
func (*TxRaw) GetSigns ¶
func (m *TxRaw) GetSigns() []*crypto.SignatureRaw
func (*TxRaw) ProtoMessage ¶
func (*TxRaw) ProtoMessage()
func (*TxRaw) XXX_DiscardUnknown ¶
func (m *TxRaw) XXX_DiscardUnknown()
func (*TxRaw) XXX_Marshal ¶
func (*TxRaw) XXX_Unmarshal ¶
type TxReceipt ¶
type TxReceipt struct { TxHash []byte GasUsage int64 /* CpuTimeUsage uint64 NetUsage uint64 RAMUsage uint64 */ Status Status SuccActionNum int32 Receipts []Receipt }
TxReceipt Transaction Receipt
func NewTxReceipt ¶
NewTxReceipt generate tx receipt for a tx hash
func (*TxReceipt) FromTxReceiptRaw ¶
func (r *TxReceipt) FromTxReceiptRaw(tr *TxReceiptRaw)
FromTxReceiptRaw convert TxReceipt from proto buf data structure
func (*TxReceipt) ToTxReceiptRaw ¶
func (r *TxReceipt) ToTxReceiptRaw() *TxReceiptRaw
ToTxReceiptRaw convert TxReceipt to proto buf data structure
type TxReceiptRaw ¶
type TxReceiptRaw struct { TxHash []byte `protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"` GasUsage int64 `protobuf:"varint,2,opt,name=gasUsage,proto3" json:"gasUsage,omitempty"` Status *StatusRaw `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"` SuccActionNum int32 `protobuf:"varint,4,opt,name=succActionNum,proto3" json:"succActionNum,omitempty"` Receipts []*ReceiptRaw `protobuf:"bytes,5,rep,name=receipts" json:"receipts,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TxReceiptRaw) Descriptor ¶
func (*TxReceiptRaw) Descriptor() ([]byte, []int)
func (*TxReceiptRaw) GetGasUsage ¶
func (m *TxReceiptRaw) GetGasUsage() int64
func (*TxReceiptRaw) GetReceipts ¶
func (m *TxReceiptRaw) GetReceipts() []*ReceiptRaw
func (*TxReceiptRaw) GetStatus ¶
func (m *TxReceiptRaw) GetStatus() *StatusRaw
func (*TxReceiptRaw) GetSuccActionNum ¶
func (m *TxReceiptRaw) GetSuccActionNum() int32
func (*TxReceiptRaw) GetTxHash ¶
func (m *TxReceiptRaw) GetTxHash() []byte
func (*TxReceiptRaw) Marshal ¶
func (m *TxReceiptRaw) Marshal() (dAtA []byte, err error)
func (*TxReceiptRaw) ProtoMessage ¶
func (*TxReceiptRaw) ProtoMessage()
func (*TxReceiptRaw) Reset ¶
func (m *TxReceiptRaw) Reset()
func (*TxReceiptRaw) Size ¶
func (m *TxReceiptRaw) Size() (n int)
func (*TxReceiptRaw) String ¶
func (m *TxReceiptRaw) String() string
func (*TxReceiptRaw) Unmarshal ¶
func (m *TxReceiptRaw) Unmarshal(dAtA []byte) error
func (*TxReceiptRaw) XXX_DiscardUnknown ¶
func (m *TxReceiptRaw) XXX_DiscardUnknown()
func (*TxReceiptRaw) XXX_Marshal ¶
func (m *TxReceiptRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TxReceiptRaw) XXX_Merge ¶
func (dst *TxReceiptRaw) XXX_Merge(src proto.Message)
func (*TxReceiptRaw) XXX_Size ¶
func (m *TxReceiptRaw) XXX_Size() int
func (*TxReceiptRaw) XXX_Unmarshal ¶
func (m *TxReceiptRaw) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.