Documentation ¶
Index ¶
- Variables
- func CheckLogTx(txBinary []byte, transactions, txQueue bool) error
- func CheckTransaction(data []byte) (*tx.Header, error)
- func CleanCache()
- 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(transaction *model.DbTransaction, binaryTx []byte, time int64) error
- func IsContractTransaction(txType int) 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 Transaction
- func (t *Transaction) AccessRights(condition string, iscondition bool) error
- func (t *Transaction) CallContract(flags int) (resultContract string, err error)
- func (t *Transaction) Check(checkTime int64, checkForDupTr bool) error
- func (t Transaction) GetLogger() *log.Entry
- func (t *Transaction) Play() (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicatedTx = errors.New("Duplicated transaction")
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 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(transaction *model.DbTransaction, binaryTx []byte, time 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 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 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 SmartContract smart.SmartContract // contains filtered or unexported fields }
Transaction is a structure for parsing transactions
func UnmarshallTransaction ¶
func UnmarshallTransaction(buffer *bytes.Buffer) (*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(flags int) (resultContract string, err error)
CallContract calls the contract functions according to the specified flags
func (*Transaction) Play ¶
func (t *Transaction) Play() (string, error)
Directories ¶
Path | Synopsis |
---|---|
MIT License Copyright (c) 2016 GenesisCommunity Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
MIT License Copyright (c) 2016 GenesisCommunity Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
Click to show internal directories.
Click to hide internal directories.