updater

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlockTimestampsParallel

func GetBlockTimestampsParallel(
	ctx context.Context,
	client blockchain.EthClient,
	startingBlock,
	lastBlock uint64,
) (map[uint64]uint64, error)

GetBlockTimestampsParallel returns a map of block numbers to timestamps in parallel. This can increase the speed of this code 2-3x TODO we should see if we can get further improvements if instead of making calls in parallel we made one call in a batch for all block numbers in a range. possibly this could execute faster because it is only one request

func GetEvoEvents

func GetEvoEvents(tx state.Tx, contract string, blockTime uint64) (uint64, []model.MintedWithExternalURI, error)

func UpdateContract

func UpdateContract(tx state.Tx,
	contract string,
	evoEvents []model.MintedWithExternalURI,
	transferEvents []model.ERC721Transfer,
	block uint64,
	evoBlock uint64,
) error

Types

type Updater

type Updater interface {
	GetModelTransferEvents(
		ctx context.Context,
		startingBlock,
		lastBlock uint64,
		contracts []string,
	) (map[uint64]map[string][]model.ERC721Transfer, error)

	UpdateState(
		ctx context.Context,
		tx state.Tx,
		contracts []string,
		newContracts map[common.Address]uint64,
		modelTransferEvents map[uint64]map[string][]model.ERC721Transfer,
		startingBlock uint64,
		lastBlockData model.Block,
	) error
}

func New

func New(client blockchain.EthClient, scanner scan.Scanner) Updater

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