Documentation ¶
Index ¶
- Constants
- func DecodeTx(bs []byte) (types.Tx, types.Error)
- func ErrFailTransfer(codespace types.CodespaceType, msg string) types.Error
- func ErrInvalidCall(codespace types.CodespaceType, msg string) types.Error
- func ErrInvalidDeploy(codespace types.CodespaceType, msg string) types.Error
- func ErrInvalidTransfer(codespace types.CodespaceType, msg string) types.Error
- func ErrInvalidTx(codespace types.CodespaceType, msg string) types.Error
- func FetchCodeValue(bs []byte) (byte, error)
- func GetNonceByAddress(addr common.Address) (uint64, error)
- type CommonTx
- func (tx *CommonTx) DecodeRLP(s *rlp.Stream) error
- func (tx CommonTx) EncodeNoSig(w io.Writer) error
- func (tx CommonTx) EncodeRLP(w io.Writer) error
- func (tx *CommonTx) SetSignature(sig []byte)
- func (tx *CommonTx) ValidateBasic() types.Error
- func (tx *CommonTx) VerifySignature(hash []byte) types.Error
- type ContractCallTx
- type ContractDeployTx
- type Transaction
- type TransferTx
- type TxIndexMapper
Constants ¶
View Source
const ( DefaultCodespace types.CodespaceType = "2" CodeInvalidTx types.CodeType = 101 CodeInvalidTransfer types.CodeType = 102 CodeFailTransfer types.CodeType = 103 CodeInvalidDeploy types.CodeType = 104 CodeInvalidCall types.CodeType = 105 )
Bank errors reserve 100 ~ 199.
View Source
const ( TRANSFER uint8 = 1 + iota CONTRACT_DEPLOY CONTRACT_CALL )
Transaction code
View Source
const (
ContractInitFunc = "init"
)
Variables ¶
This section is empty.
Functions ¶
func ErrFailTransfer ¶
func ErrFailTransfer(codespace types.CodespaceType, msg string) types.Error
func ErrInvalidCall ¶
func ErrInvalidCall(codespace types.CodespaceType, msg string) types.Error
func ErrInvalidDeploy ¶
func ErrInvalidDeploy(codespace types.CodespaceType, msg string) types.Error
func ErrInvalidTransfer ¶
func ErrInvalidTransfer(codespace types.CodespaceType, msg string) types.Error
func ErrInvalidTx ¶
func ErrInvalidTx(codespace types.CodespaceType, msg string) types.Error
func FetchCodeValue ¶ added in v0.3.0
FetchCodeValue returns code from rlp bytes
Types ¶
type ContractCallTx ¶
type ContractCallTx struct { Common CommonTx Address common.Address Func string // function name Args [][]byte RWSetsHash []byte }
func DecodeContractCallTx ¶ added in v0.3.0
func DecodeContractCallTx(b []byte) (*ContractCallTx, error)
func (*ContractCallTx) Bytes ¶
func (tx *ContractCallTx) Bytes() []byte
func (*ContractCallTx) Decode ¶
func (tx *ContractCallTx) Decode(b []byte) error
func (*ContractCallTx) GetSignBytes ¶
func (tx *ContractCallTx) GetSignBytes() []byte
func (*ContractCallTx) SetSignature ¶ added in v0.3.0
func (tx *ContractCallTx) SetSignature(sig []byte)
func (*ContractCallTx) ValidateBasic ¶
func (tx *ContractCallTx) ValidateBasic() types.Error
type ContractDeployTx ¶
func DecodeContractDeployTx ¶ added in v0.3.0
func DecodeContractDeployTx(b []byte) (*ContractDeployTx, error)
func (*ContractDeployTx) Bytes ¶
func (tx *ContractDeployTx) Bytes() []byte
func (*ContractDeployTx) Decode ¶
func (tx *ContractDeployTx) Decode(b []byte) error
func (*ContractDeployTx) GetSignBytes ¶
func (tx *ContractDeployTx) GetSignBytes() []byte
func (*ContractDeployTx) SetSignature ¶ added in v0.3.0
func (tx *ContractDeployTx) SetSignature(sig []byte)
func (*ContractDeployTx) ValidateBasic ¶
func (tx *ContractDeployTx) ValidateBasic() types.Error
type Transaction ¶
type TransferTx ¶
func DecodeTransferTx ¶ added in v0.3.0
func DecodeTransferTx(b []byte) (*TransferTx, error)
func (*TransferTx) Bytes ¶
func (tx *TransferTx) Bytes() []byte
func (*TransferTx) GetSignBytes ¶
func (tx *TransferTx) GetSignBytes() []byte
func (*TransferTx) SetSignature ¶ added in v0.3.0
func (tx *TransferTx) SetSignature(sig []byte)
func (*TransferTx) ValidateBasic ¶
func (tx *TransferTx) ValidateBasic() types.Error
type TxIndexMapper ¶
func NewTxIndexMapper ¶
func NewTxIndexMapper(k types.StoreKey) TxIndexMapper
Click to show internal directories.
Click to hide internal directories.