blocks

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEstimatedBlockTimeForTransaction

func GetEstimatedBlockTimeForTransaction(uniqueBlocksMap BlockMap, blockNumber uint64, txIndex uint) time.Time

Types

type BlockDataFromSource

type BlockDataFromSource struct {
	BlockNumber      uint64
	BlockTimestamp   time.Time
	TransactionCount uint
}

BlockDataFromSource is the data received from source (the chain)

func GetBlockFromChain

func GetBlockFromChain(client ethereum.ChainReader, blockKey BlockKey) (
	blockData BlockDataFromSource, err error)

type BlockKey

type BlockKey struct {
	BlockNumber uint64
}

type BlockMap

type BlockMap map[BlockKey]BlockMapValue

func BuildUniqueBlocksFromEvents

func BuildUniqueBlocksFromEvents(allEvents []*chain.TransferEvent) (uniqueBlocksMap BlockMap)

type BlockMapValue

type BlockMapValue struct {
	BlockTimestamp   time.Time
	TransactionCount uint
}

Jump to

Keyboard shortcuts

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