evolution

package
v0.0.0-...-0ff5682 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProcessor

func NewProcessor(client blockchain.EthClient,
	stateService state.Service,
	scanner scan.Scanner,
	laosHTTP LaosRPCRequests,
	c *config.Config,
) *processor

Types

type Block

type Block struct {
	Header BlockHeader `json:"header"`
}

Block struct to represent the block in the JSON response

type BlockHeader

type BlockHeader struct {
	ParentHash     string `json:"parentHash"`
	Number         string `json:"number"`
	StateRoot      string `json:"stateRoot"`
	ExtrinsicsRoot string `json:"extrinsicsRoot"`
}

BlockHeader struct to represent the block header in the JSON response

type ChainGetBlock

type ChainGetBlock struct {
	JSONRPC string `json:"jsonrpc"`
	Result  struct {
		Block Block `json:"block"`
	} `json:"result"`
	ID int `json:"id"`
}

Response struct to represent the entire JSON response

type ChainGetFinalizedHead

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

Response struct to represent the entire JSON response

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

Define an interface for HTTP client operations

type LaosHTTP

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

func (LaosHTTP) BlockNumber

func (l LaosHTTP) BlockNumber(blockHash string) (*big.Int, error)

func (LaosHTTP) LatestFinalizedBlockHash

func (l LaosHTTP) LatestFinalizedBlockHash() (string, error)

type LaosRPCRequests

type LaosRPCRequests interface {
	LatestFinalizedBlockHash() (string, error)
	BlockNumber(blockHash string) (*big.Int, error)
}

Define an interface for HTTP client operations

func NewLaosHTTP

func NewLaosHTTP(client HTTPClient, url string) LaosRPCRequests

type Processor

type Processor interface {
	GetInitStartingBlock(ctx context.Context) (uint64, error)
	GetLastBlock(ctx context.Context, startingBlock uint64) (uint64, error)
	VerifyChainConsistency(ctx context.Context, startingBlock uint64) error
	ProcessEvoBlockRange(ctx context.Context, startingBlock, lastBlock uint64) error
}

type ReorgError

type ReorgError struct {
	Block       uint64
	ChainHash   common.Hash
	StorageHash common.Hash
}

func (ReorgError) Error

func (e ReorgError) Error() string

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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