Documentation
¶
Index ¶
- Constants
- func BytesToEthHex(b []byte) string
- func FromReceiptDBType(receipt ReceiptDB) (*ethtypes.Receipt, error)
- func FromTransactionDBType(transaction TransactionDB) (*ethtypes.Transaction, error)
- func FromTransactionResultDB(txResult TransactionResultDB) (btcjson.GetTransactionResult, error)
- func FromTransactionResultSQLType(txSQL TransactionResultSQLType) (btcjson.GetTransactionResult, error)
- type DynamicTicker
- type LastBlockSQLType
- type OutboundHashSQLType
- type ReceiptDB
- type ReceiptSQLType
- type Status
- type TransactionDB
- type TransactionResultDB
- type TransactionResultSQLType
- type TransactionSQLType
Constants ¶
const LastBlockNumID = 0xBEEF
Variables ¶
This section is empty.
Functions ¶
func BytesToEthHex ¶
EthHexToBytes converts an Ethereum hex string to bytes
func FromReceiptDBType ¶
FromReceiptDBType : Converts a ReceiptDB type to an Ethereum receipt
func FromTransactionDBType ¶
func FromTransactionDBType(transaction TransactionDB) (*ethtypes.Transaction, error)
FromTransactionDBType : Converts a TransactionDB type to an Ethereum transaction
func FromTransactionResultDB ¶
func FromTransactionResultDB(txResult TransactionResultDB) (btcjson.GetTransactionResult, error)
func FromTransactionResultSQLType ¶
func FromTransactionResultSQLType(txSQL TransactionResultSQLType) (btcjson.GetTransactionResult, error)
Types ¶
type DynamicTicker ¶
type DynamicTicker struct {
// contains filtered or unexported fields
}
DynamicTicker is a ticker that can have its interval updated
func NewDynamicTicker ¶
func NewDynamicTicker(name string, interval uint64) (*DynamicTicker, error)
NewDynamicTicker creates a new DynamicTicker
func (*DynamicTicker) C ¶
func (t *DynamicTicker) C() <-chan time.Time
C returns the channel of the ticker
func (*DynamicTicker) UpdateInterval ¶
func (t *DynamicTicker) UpdateInterval(newInterval uint64, logger zerolog.Logger)
UpdateInterval updates the interval of the ticker
type LastBlockSQLType ¶
func ToLastBlockSQLType ¶
func ToLastBlockSQLType(lastBlock uint64) *LastBlockSQLType
ToLastBlockSQLType : Converts a last block number to a LastBlockSQLType
type OutboundHashSQLType ¶
func ToOutboundHashSQLType ¶
func ToOutboundHashSQLType(hash string, key string) OutboundHashSQLType
type ReceiptDB ¶
type ReceiptDB struct { // Consensus fields: These fields are defined by the Yellow Paper Type uint8 PostState []byte Status uint64 CumulativeGasUsed uint64 Bloom []byte Logs []byte // Implementation fields: These fields are added by geth when processing a transaction. // They are stored in the chain database. TxHash common.Hash ContractAddress common.Address GasUsed uint64 // Inclusion information: These fields provide information about the inclusion of the // transaction corresponding to this receipt. BlockHash common.Hash BlockNumber *big.Int `gorm:"embedded"` TransactionIndex uint }
ReceiptDB : A modified receipt struct that the relational mapping can translate
type ReceiptSQLType ¶
func ToReceiptSQLType ¶
func ToReceiptSQLType(receipt *ethtypes.Receipt, index string) (*ReceiptSQLType, error)
ToReceiptSQLType : Converts an Ethereum receipt to a ReceiptSQLType
type Status ¶
type Status struct {
BTCNumberOfUTXOs int `json:"btc_number_of_utxos"`
}
Status type for telemetry. More fields can be added as needed
type TransactionDB ¶
type TransactionDB struct { // Data that can be used for queries Type byte ChainID *big.Int `gorm:"embedded"` Nonce uint64 To *common.Address Hash common.Hash // Serialized go-ethereum transaction TransactionData []byte }
TransactionDB : A modified Transaction struct that the relational mapping can translate. Inner transaction data is defined as an interface from eth types, so it will be serialized and stored as bytes.
func ToTransactionDBType ¶
func ToTransactionDBType(transaction *ethtypes.Transaction) (TransactionDB, error)
ToTransactionDBType : Converts an Ethereum transaction to a TransactionDB type
type TransactionResultDB ¶
type TransactionResultDB struct { Amount float64 Fee float64 Confirmations int64 BlockHash string BlockIndex int64 BlockTime int64 TxID string WalletConflicts []byte Time int64 TimeReceived int64 Details []byte // btcjson.GetTransactionDetailsResult Hex string }
func ToTransactionResultDB ¶
func ToTransactionResultDB(txResult btcjson.GetTransactionResult) (TransactionResultDB, error)
type TransactionResultSQLType ¶
type TransactionResultSQLType struct { gorm.Model Key string Tx TransactionResultDB `gorm:"embedded"` }
func ToTransactionResultSQLType ¶
func ToTransactionResultSQLType(txResult btcjson.GetTransactionResult, key string) (TransactionResultSQLType, error)
type TransactionSQLType ¶
type TransactionSQLType struct { gorm.Model Identifier string Transaction TransactionDB `gorm:"embedded"` }
func ToTransactionSQLType ¶
func ToTransactionSQLType(transaction *ethtypes.Transaction, index string) (*TransactionSQLType, error)
ToTransactionSQLType : Converts an Ethereum transaction to a TransactionSQLType