Documentation ¶
Index ¶
- Variables
- func CheckLogTx(txHash []byte, transactions, txQueue bool) error
- func CheckTransaction(data []byte) (*tx.Header, error)
- func CleanCache()
- func CreateContract(contractName string, keyID int64, params map[string]interface{}, ...) error
- func DeleteQueueTx(dbTransaction *model.DbTransaction, hash []byte) error
- func GetTransaction(t *Transaction, txType string) (custom.TransactionInterface, error)
- func GetTxTypeAndUserID(binaryBlock []byte) (txType int64, keyID int64)
- func InsertInLogTx(t *Transaction, blockID int64) error
- func IsContractTransaction(txType int64) bool
- func MarkTransactionBad(dbTransaction *model.DbTransaction, hash []byte, errText string) error
- func ProcessQueueTransaction(dbTransaction *model.DbTransaction, hash, binaryTx []byte, myTx bool) error
- func ProcessTransactionsQueue(dbTransaction *model.DbTransaction) error
- type RawTransaction
- type Transaction
- func (t *Transaction) AccessRights(condition string, iscondition bool) error
- func (t *Transaction) CallContract() (resultContract string, flushRollback []smart.FlushInfo, err error)
- func (t *Transaction) CallOBSContract() (resultContract string, flushRollback []smart.FlushInfo, err error)
- func (t *Transaction) Check(checkTime int64, checkForDupTr bool) error
- func (t Transaction) GetLogger() *log.Entry
- func (t *Transaction) Play() (string, []smart.FlushInfo, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicatedTx = errors.New("Duplicated transaction") ErrNotComeTime = errors.New("Transaction processing time has not come") ErrExpiredTime = errors.New("Transaction processing time is expired") ErrEarlyTime = utils.WithBan(errors.New("Early transaction time")) ErrEmptyKey = utils.WithBan(errors.New("KeyID is empty")) )
Functions ¶
func CheckLogTx ¶
CheckLogTx checks if this transaction exists And it would have successfully passed a frontal test
func CheckTransaction ¶
CheckTransaction is checking transaction
func CreateContract ¶
func DeleteQueueTx ¶
func DeleteQueueTx(dbTransaction *model.DbTransaction, hash []byte) error
DeleteQueueTx deletes a transaction from the queue
func GetTransaction ¶
func GetTransaction(t *Transaction, txType string) (custom.TransactionInterface, error)
func GetTxTypeAndUserID ¶
GetTxTypeAndUserID returns tx type, wallet and citizen id from the block data
func InsertInLogTx ¶
func InsertInLogTx(t *Transaction, blockID int64) error
InsertInLogTx is inserting tx in log
func IsContractTransaction ¶
IsContractTransaction checks txType
func MarkTransactionBad ¶
func MarkTransactionBad(dbTransaction *model.DbTransaction, hash []byte, errText string) error
func ProcessQueueTransaction ¶
func ProcessQueueTransaction(dbTransaction *model.DbTransaction, hash, binaryTx []byte, myTx bool) error
TxParser writes transactions into the queue
func ProcessTransactionsQueue ¶
func ProcessTransactionsQueue(dbTransaction *model.DbTransaction) error
AllTxParser parses new transactions
Types ¶
type RawTransaction ¶
type RawTransaction struct {
// contains filtered or unexported fields
}
func (*RawTransaction) Bytes ¶
func (rtx *RawTransaction) Bytes() []byte
func (*RawTransaction) Hash ¶
func (rtx *RawTransaction) Hash() []byte
func (*RawTransaction) Payload ¶
func (rtx *RawTransaction) Payload() []byte
func (*RawTransaction) Signature ¶
func (rtx *RawTransaction) Signature() []byte
func (*RawTransaction) Type ¶
func (rtx *RawTransaction) Type() int64
func (*RawTransaction) Unmarshall ¶
func (rtx *RawTransaction) Unmarshall(buffer *bytes.Buffer) error
type Transaction ¶
type Transaction struct { BlockData *utils.BlockData PrevBlock *utils.BlockData PublicKeys [][]byte TxBinaryData []byte // transaction binary data TxFullData []byte // full transaction, with type and data TxHash []byte TxSignature []byte TxKeyID int64 TxTime int64 TxType int64 TxCost int64 // Maximum cost of executing contract TxFuel int64 TxUsedCost decimal.Decimal // Used cost of CPU resources TxPtr interface{} // Pointer to the corresponding struct in consts/struct.go TxData map[string]interface{} TxSmart *tx.SmartContract TxContract *smart.Contract TxHeader *tx.Header DbTransaction *model.DbTransaction SysUpdate bool Rand *rand.Rand Notifications types.Notifications GenBlock bool TimeLimit int64 SmartContract smart.SmartContract // contains filtered or unexported fields }
Transaction is a structure for parsing transactions
func UnmarshallTransaction ¶
func UnmarshallTransaction(buffer *bytes.Buffer, fillData bool) (*Transaction, error)
UnmarshallTransaction is unmarshalling transaction
func (*Transaction) AccessRights ¶
func (t *Transaction) AccessRights(condition string, iscondition bool) error
AccessRights checks the access right by executing the condition value
func (*Transaction) CallContract ¶
func (t *Transaction) CallContract() (resultContract string, flushRollback []smart.FlushInfo, err error)
CallContract calls the contract functions according to the specified flags
func (*Transaction) CallOBSContract ¶
func (t *Transaction) CallOBSContract() (resultContract string, flushRollback []smart.FlushInfo, err error)
Click to show internal directories.
Click to hide internal directories.