Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Authentication error codes ErrCodeInvalidAuthHeader = 40000 ErrCodeInvalidAuthCredentials = 40001 // Implementation error codes RPCErrCodeInvalidParamType = 60000 RPCErrCodeInvalidParamValue = 60001 )
RPC error codes
View Source
const ( ErrCodeFailedDecode = uint32(1) ErrCodeExecFailure = uint32(2) ErrCodeMaxTxTypeReached = 3 )
Transaction processing errors
View Source
const TxMetaKeyAllowNonceGap = "allowNonceGap"
Variables ¶
View Source
var ( ErrKeyUnknown = fmt.Errorf("key not found") ErrAccountUnknown = fmt.Errorf("account not found") ErrPushKeyUnknown = fmt.Errorf("push key not found") ErrInvalidPrivKey = fmt.Errorf("private key is invalid") ErrRepoNotFound = fmt.Errorf("repo not found") ErrTxNotFound = fmt.Errorf("transaction not found") ErrInvalidPassphrase = fmt.Errorf("invalid passphrase") )
General
View Source
var ( ErrCodeTxBadEncode uint32 = 20000 ErrCodeTxFailedValidation uint32 = 20001 ErrCodeTxPoolReject uint32 = 20002 )
ABI App Error Codes
View Source
var ErrExit = fmt.Errorf("exit")
View Source
var ( // ErrIntSliceArgDecode means an interface slice parameter could not be decoded ErrIntSliceArgDecode = func(castType string, index, sliceIndex int) error { sliceIndexStr := "" if sliceIndex > -1 { sliceIndexStr = fmt.Sprintf("[%d]", sliceIndex) } return fmt.Errorf("failed to decode argument.%d%s to %s", index, sliceIndexStr, castType) } )
Decode/Cast Error
View Source
var ErrSkipped = fmt.Errorf("skipped")
Functions ¶
This section is empty.
Types ¶
type BaseTx ¶
type BaseTx interface { msgpack.CustomEncoder msgpack.CustomDecoder Meta // GetType returns the type of the transaction GetType() TxCode // GetSignature returns the transaction signature GetSignature() []byte // SetSignature sets the transaction signature SetSignature(s []byte) // GetSenderPubKey returns the transaction sender public key GetSenderPubKey() ed25519.PublicKey // SetSenderPubKey sets the transaction sender public key SetSenderPubKey(pk []byte) // GetTimestamp return the transaction creation unix timestamp GetTimestamp() int64 // SetTimestamp sets the transaction creation unix timestamp SetTimestamp(t int64) // GetNonce returns the transaction nonce GetNonce() uint64 // SetNonce set the transaction nonce SetNonce(nonce uint64) // SetFee sets the transaction fee SetFee(fee util.String) // GetFee returns the transaction fee GetFee() util.String // GetFrom returns the address of the transaction sender GetFrom() identifier.Address // GetHash returns the hash of the transaction GetHash() util.HexBytes // GetBytesNoSig returns the serialized the tx excluding the signature GetBytesNoSig() []byte // Bytes Returns the serialized transaction Bytes() []byte // ComputeHash computes the hash of the transaction ComputeHash() util.Bytes32 // GetID returns the id of the transaction (also the hash) GetID() string // Sign signs the transaction Sign(privKey string) ([]byte, error) // GetEcoSize returns the size of the tx for use in fee calculation. // Size returned here may not be the actual tx size. GetEcoSize() int64 // GetSize returns the size of the tx object (excluding nothing) GetSize() int64 // ToMap returns a map equivalent of the transaction ToMap() map[string]interface{} // FromMap populate the fields from a map FromMap(map[string]interface{}) error // Is Id checks if the tx is a given type Is(txType TxCode) bool }
BaseTx describes a base transaction
type BasicMeta ¶ added in v0.0.29
type BasicMeta struct {
// contains filtered or unexported fields
}
BasicMeta stores arbitrary, self-contained state information for a transaction
func (*BasicMeta) HasMetaKey ¶ added in v0.0.29
HasMetaKey returns true if the given key exist in the meta map
Click to show internal directories.
Click to hide internal directories.