execution

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedGetBlockQuery = errors.New("unsupported get block query")

Functions

This section is empty.

Types

type Block

type Block struct {
	Number *big.Int
	// contains filtered or unexported fields
}

func (*Block) GetResult added in v0.0.3

func (b *Block) GetResult() *ResultGetBlock

type Config

type Config struct {
	ChainID                 string `yaml:"chainId" default:"0x1"`
	TerminalTotalDifficulty string `yaml:"terminalTotalDifficulty" default:"0x0"`
	TerminalBlockHash       string `yaml:"terminalBlockHash" default:"0x0000000000000000000000000000000000000000000000000000000000000000"`
	TerminalBlockNumber     string `yaml:"terminalBlockNumber" default:"0x0"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Handler

type Handler struct {
	Cfg Config
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(log logrus.FieldLogger, conf *Config) *Handler

NewHandler returns a new Handler instance.

func (*Handler) Request

func (h *Handler) Request(ctx context.Context, id int, method string, params []*json.RawMessage) (*Response, error)

func (*Handler) Start added in v0.0.5

func (h *Handler) Start(ctx context.Context)

type RequestParamsExchangeCapabilities added in v0.0.2

type RequestParamsExchangeCapabilities []string

type RequestParamsForkchoiceUpdatedV1

type RequestParamsForkchoiceUpdatedV1 struct {
	HeadBlockHash string `json:"headBlockHash"`
}

type RequestParamsNewPayloadV1

type RequestParamsNewPayloadV1 struct {
	ParentHash    string   `json:"parentHash"`
	FeeRecipient  string   `json:"feeRecipient"`
	StateRoot     string   `json:"stateRoot"`
	ReceiptsRoot  string   `json:"receiptsRoot"`
	LogsBloom     string   `json:"logsBloom"`
	Random        string   `json:"prevRandao"`
	BlockNumber   string   `json:"blockNumber"`
	GasLimit      string   `json:"gasLimit"`
	GasUsed       string   `json:"gasUsed"`
	Timestamp     string   `json:"timestamp"`
	ExtraData     string   `json:"extraData"`
	BaseFeePerGas string   `json:"baseFeePerGas"`
	BlockHash     string   `json:"blockHash"`
	Transactions  []string `json:"transactions"`
}

type Response

type Response struct {
	ID      int         `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

type ResultChainID

type ResultChainID string

type ResultDefault

type ResultDefault bool

type ResultExchangeTransitionConfigurationV1

type ResultExchangeTransitionConfigurationV1 struct {
	TerminalTotalDifficulty string `json:"terminalTotalDifficulty"`
	TerminalBlockHash       string `json:"terminalBlockHash"`
	TerminalBlockNumber     string `json:"terminalBlockNumber"`
}

type ResultForkchoiceUpdatedV1

type ResultForkchoiceUpdatedV1 struct {
	PayloadStatus ResultForkchoiceUpdatedV1PayloadStatus `json:"payloadStatus"`
	PayloadID     string                                 `json:"payloadId"`
}

type ResultForkchoiceUpdatedV1PayloadStatus

type ResultForkchoiceUpdatedV1PayloadStatus struct {
	Status          string `json:"status"`
	LatestValidHash string `json:"latestValidHash"`
	ValidationError string `json:"validationError"`
}

type ResultGetBlock added in v0.0.3

type ResultGetBlock struct {
	Number       string   `json:"number"`
	Hash         string   `json:"hash"`
	ParentHash   string   `json:"parentHash"`
	LogsBloom    string   `json:"logsBloom"`
	StateRoot    string   `json:"stateRoot"`
	ReceiptsRoot string   `json:"receiptsRoot"`
	ExtraData    string   `json:"extraData"`
	GasLimit     string   `json:"gasLimit"`
	GasUsed      string   `json:"gasUsed"`
	Timestamp    string   `json:"timestamp"`
	Transactions []string `json:"transactions"`
}

type ResultNewPayloadV1

type ResultNewPayloadV1 struct {
	Status          string `json:"status"`
	LatestValidHash string `json:"latestValidHash"`
	ValidationError string `json:"validationError"`
}

type ResultexchangeCapabilities added in v0.0.2

type ResultexchangeCapabilities []string

type Storage added in v0.0.5

type Storage struct {
	// contains filtered or unexported fields
}

func (*Storage) AddBlock added in v0.0.5

func (s *Storage) AddBlock(payload *RequestParamsNewPayloadV1, raw *json.RawMessage)

func (*Storage) GetBlockByHash added in v0.0.5

func (s *Storage) GetBlockByHash(hash string) *Block

func (*Storage) GetBlockByNumber added in v0.0.5

func (s *Storage) GetBlockByNumber(number *big.Int) *Block

func (*Storage) GetLatestBlock added in v0.0.5

func (s *Storage) GetLatestBlock() *Block

func (*Storage) Start added in v0.0.5

func (s *Storage) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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