utils

package
v0.38.0-preview.0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Devnet51Config = Config{
	// contains filtered or unexported fields
}
View Source
var Mainnet25Config = Config{
	// contains filtered or unexported fields
}

Functions

func CollectEventData

func CollectEventData(conf *Config, path string) error

func IsEVMRootHeight

func IsEVMRootHeight(chainID flow.ChainID, flowHeight uint64) bool

EVM Root Height is the first block that has EVM Block Event where the EVM block height is 1

func IsSporkHeight

func IsSporkHeight(chainID flow.ChainID, flowHeight uint64) bool

IsSporkHeight returns true if the given flow height is a spork height for the given chainID At spork height, there is no EVM events

func OffchainReplayBackwardCompatibilityTest

func OffchainReplayBackwardCompatibilityTest(
	log zerolog.Logger,
	chainID flow.ChainID,
	flowStartHeight uint64,
	flowEndHeight uint64,
	headers storage.Headers,
	results storage.ExecutionResults,
	executionDataStore execution_data.ExecutionDataGetter,
	store environment.ValueStore,
	onHeightReplayed func(uint64) error,
) error

OffchainReplayBackwardCompatibilityTest replays the offchain EVM state transition for a given range of flow blocks, the replay will also verify the StateUpdateChecksum of the EVM state transition from each transaction execution. the updated register values will be saved to the given value store.

func ReplayEVMEventsToStore

func ReplayEVMEventsToStore(
	log zerolog.Logger,
	store environment.ValueStore,
	chainID flow.ChainID,
	rootAddr flow.Address,
	evmBlockEvent *events.BlockEventPayload,
	evmTxEvents []events.TransactionEventPayload,
) (
	map[flow.RegisterID]flow.RegisterValue,
	map[flow.RegisterID]flow.RegisterValue,
	error,
)

func VerifyRegisterUpdates

func VerifyRegisterUpdates(expectedUpdates map[flow.RegisterID]flow.RegisterValue, actualUpdates map[flow.RegisterID]flow.RegisterValue) error

Types

type Config

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

type EVMEventsAccumulator

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

func NewEVMEventsAccumulator

func NewEVMEventsAccumulator() *EVMEventsAccumulator

func (*EVMEventsAccumulator) HasBlockEvent

type Event

type Event struct {
	FlowBlockHeight uint64 `json:"flow_height"`
	EventType       string `json:"type"`
	EventPayload    string `json:"payload"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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