types

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName   = "infura"
	QuerierRoute = ModuleName
	// RouterKey is the msg router key for the backend module
	RouterKey = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Number           int64  `gorm:"primaryKey"`
	Hash             string `gorm:"type:varchar(66);index;not null"`
	ParentHash       string `gorm:"type:varchar(66)"`
	TransactionsRoot string `gorm:"type:varchar(66)"`
	StateRoot        string `gorm:"type:varchar(66)"`
	Miner            string `gorm:"type:varchar(42)"`
	Size             uint64 `gorm:"type:int(11)"`
	GasLimit         uint64
	GasUsed          uint64
	Timestamp        uint64 `gorm:"type:int(11)"`
	Transactions     []*Transaction
	CreatedAt        time.Time
	UpdatedAt        time.Time
	DeletedAt        gorm.DeletedAt `gorm:"index"`
}

type Config

type Config struct {
	RedisUrl       string
	RedisAuth      string
	RedisDB        int
	MysqlUrl       string
	MysqlUser      string
	MysqlPass      string
	MysqlDB        string
	CacheQueueSize int
}

type ContractCode

type ContractCode struct {
	gorm.Model
	Address     string `gorm:"type:varchar(42);index:unique_address,unique;not null"`
	Code        string
	BlockNumber int64
}

type EngineData

type EngineData struct {
	TransactionReceipts []*TransactionReceipt
	Block               *Block
	ContractCodes       []*ContractCode
}

type IDistributeStateService

type IDistributeStateService interface {
	GetLockerID() string
	GetDistState(stateKey string) string
	SetDistState(stateKey string, stateValue string) error
	FetchDistLock(lockKey string, locker string, expiredInMS int) (bool, error)
	ReleaseDistLock(lockKey string, locker string) (bool, error)
	UnlockDistLockWithState(lockKey string, locker string, stateKey string, stateValue string) (bool, error)
}

Distributed State Service Interface

type IStreamData

type IStreamData interface {
	ConvertEngineData() EngineData
}

type IStreamEngine

type IStreamEngine interface {
	Write(data IStreamData) bool
}

***********************************

type LogTopic

type LogTopic struct {
	gorm.Model
	Topic            string `gorm:"type:varchar(66)"`
	TransactionLogID uint
}

type StreamData

type StreamData struct {
	TransactionReceipts []evm.TransactionReceipt
	Block               evm.Block
	Transactions        []evm.Transaction
	ContractCodes       map[string][]byte
}

func (StreamData) ConvertEngineData

func (sd StreamData) ConvertEngineData() EngineData

type Transaction

type Transaction struct {
	gorm.Model
	BlockHash   string `gorm:"type:varchar(66)"`
	BlockNumber int64
	From        string `gorm:"type:varchar(42)"`
	Gas         uint64 `gorm:"type:int(11)"`
	GasPrice    string `gorm:"type:varchar(66)"`
	Hash        string `gorm:"type:varchar(66)"`
	Input       string `gorm:"type:text"`
	Nonce       uint64 `gorm:"type:int(11)"`
	To          string `gorm:"type:varchar(42)"`
	Index       uint64 `gorm:"type:int(11)"`
	Value       string `gorm:"type:varchar(255)"`
	V           string `gorm:"type:varchar(255)"`
	R           string `gorm:"type:varchar(255)"`
	S           string `gorm:"type:varchar(255)"`
}

type TransactionLog

type TransactionLog struct {
	gorm.Model
	Address              string `gorm:"type:varchar(42);index;not null"`
	Data                 string `gorm:"type:text"`
	TransactionHash      string `gorm:"type:varchar(66)"`
	TransactionIndex     uint64 `gorm:"type:int(11)"`
	LogIndex             uint64 `gorm:"type:int(11)"`
	BlockHash            string `gorm:"type:varchar(66);index;not null"`
	BlockNumber          int64  `gorm:"index;not null"`
	TransactionReceiptID uint
	Topics               []LogTopic
}

type TransactionReceipt

type TransactionReceipt struct {
	gorm.Model
	Status            uint64 `gorm:"type:tinyint(4)"`
	CumulativeGasUsed uint64 `gorm:"type:int(11)"`
	TransactionHash   string `gorm:"type:varchar(66);index;not null"`
	ContractAddress   string `gorm:"type:varchar(42)"`
	GasUsed           uint64 `gorm:"type:int(11)"`
	BlockHash         string `gorm:"type:varchar(66)"`
	BlockNumber       int64
	TransactionIndex  uint64 `gorm:"type:int(11)"`
	From              string `gorm:"type:varchar(42)"`
	To                string `gorm:"type:varchar(42)"`
	Logs              []TransactionLog
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL