Documentation ¶
Index ¶
- func GetAddresses(dump *state.Dump) []string
- func GetBlock(ec *ethclient.Client, blockNumber *big.Int) (*types.Block, error)
- func GetBlockState(c *rpc.Client, blockNumber *big.Int) (*state.Dump, error)
- func GetGoldTokenBalanceFromStateDump(c *rpc.Client, accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func GetLatestBlockNumber(c *rpc.Client) (*big.Int, error)
- func GetStateAddressesWithRelevantData(dump *state.Dump) map[string]RelevantStateData
- func GetSystemGoldTokenSupplyFromStateDump(c *rpc.Client, atBlockNumber *big.Int) (*big.Int, error)
- type GasReceipt
- type HeaderLite
- type ReceiptLite
- type RelevantStateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddresses ¶
GetAddresses extracts all addresses specified in the provided state dump and returns them as a slice
func GetBlock ¶
GetBlock returns the full block (including transactional data) for the given block number
func GetBlockState ¶
GetBlockState returns the state dump for the given block number
func GetGoldTokenBalanceFromStateDump ¶
func GetGoldTokenBalanceFromStateDump(c *rpc.Client, accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
GetGoldTokenBalanceFromStateDump returns the gold token balanace of an address on the Celo blockchain at a particular block height as reported by the state dump. This function is relevant to fetch balances for when the GoldToken contract hasn't been activated on the blockchain. i.e. for block numbers : 0 (genesis) to T-1 (where T is the block height at which the GoldToken contract is initialised)
func GetLatestBlockNumber ¶
GetLatestBlockNumber returns the latest block number encountered by the full node of the Celo blockchain
func GetStateAddressesWithRelevantData ¶
func GetStateAddressesWithRelevantData(dump *state.Dump) map[string]RelevantStateData
GetStateAddressesWithRelevantData extracts all addresses specified in a state dump and returns a mapping of these addresses to their corresponding gold token balances as reported by the state dump
func GetSystemGoldTokenSupplyFromStateDump ¶
GetSystemGoldTokenSupplyFromStateDump returns the total gold token supply of the Celo blockchain at a particular block height as reported by the state dump This function is relevant to fetch total gold token supply when the GoldToken contract hasn't been activated on the blockchain. i.e. for block numbers : 0 (genesis) to T-1 (where T is the block height at which the GoldToken contract is initialised)
Types ¶
type GasReceipt ¶
type GasReceipt struct { TxHash common.Hash `json:"transactionHash"` CumulativeGasUsed uint64 `json:"cumulativeGasUsed"` GasUsed uint64 `json:"gasUsed"` }
GasReceipt is a struct to store gas related details from a transaction receipt
func GetGasReceipt ¶
func GetGasReceipt(ec *ethclient.Client, txHash common.Hash) *GasReceipt
GetGasReceipt extracts and returns gas details from the transaction receipt of the given tx hash
type HeaderLite ¶
func GetGenesisHeaderLite ¶
func GetGenesisHeaderLite(c *rpc.Client) (*HeaderLite, error)
GetGenesisHeaderLite returns the timestamp of the genesis blocknumber wrapped in a HeaderLite object
func GetHeaderLite ¶
GetHeaderLite returns the timestamp of the specified blocknumber wrapped in a HeaderLite object
func GetLatestHeaderLite ¶
func GetLatestHeaderLite(c *rpc.Client) (*HeaderLite, error)
GetLatestHeaderLite returns the timestamp of the latest blocknumber wrapped in a HeaderLite object
type ReceiptLite ¶
type ReceiptLite struct { TxHash string `json:"transactionHash" gencodec:"required"` Logs []*types.Log `json:"logs" gencodec:"required"` From string `json:"from"` To string `json:"to"` }
ReceiptLite represents a subset of a transaction receipt to store receipt data relevant to Icarus
func GetReceiptLite ¶
func GetReceiptLite(c *rpc.Client, txHash string) (*ReceiptLite, error)
GetReceiptLite extracts and returns (relevant to Icarus) details from the transaction receipt of the given txhash
type RelevantStateData ¶
RelevantStateData is a wrapper around state dump data points that we intend to return for each address in GetStateAddressesWithRelevantData Currently, it only contains Gold Token Balance