cache

package
v1.2.2-mainnet Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CfxDefault = NewCfx()
View Source
var EthDefault = NewEth()

Functions

This section is empty.

Types

type CfxCache

type CfxCache struct {
	*StatusCache
	// contains filtered or unexported fields
}

CfxCache memory cache for some core space RPC methods

func NewCfx

func NewCfx() *CfxCache

func (*CfxCache) GetClientVersion

func (cache *CfxCache) GetClientVersion(cfx sdk.ClientOperator) (string, error)

func (*CfxCache) GetGasPrice

func (cache *CfxCache) GetGasPrice(cfx sdk.ClientOperator) (*hexutil.Big, error)

type EthCache

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

EthCache memory cache for some evm space RPC methods

func NewEth

func NewEth() *EthCache

func (*EthCache) GetBlockNumber

func (cache *EthCache) GetBlockNumber(client *node.Web3goClient) (*hexutil.Big, error)

func (*EthCache) GetChainId

func (cache *EthCache) GetChainId(client *web3go.Client) (*hexutil.Uint64, error)

func (*EthCache) GetClientVersion

func (cache *EthCache) GetClientVersion(client *web3go.Client) (string, error)

func (*EthCache) GetGasPrice

func (cache *EthCache) GetGasPrice(client *web3go.Client) (*hexutil.Big, error)

func (*EthCache) GetNetVersion

func (cache *EthCache) GetNetVersion(client *web3go.Client) (string, error)

type StatusCache

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

StatusCache memory cache for core space status related RPC method suites.

func NewStatusCache

func NewStatusCache() *StatusCache

func (*StatusCache) GetBestBlockHash

func (c *StatusCache) GetBestBlockHash(cfx sdk.ClientOperator) (types.Hash, error)

func (*StatusCache) GetEpochNumber

func (c *StatusCache) GetEpochNumber(cfx sdk.ClientOperator, epoch *types.Epoch) (*hexutil.Big, error)

func (*StatusCache) GetStatus

func (c *StatusCache) GetStatus(cfx sdk.ClientOperator) (types.Status, error)

Jump to

Keyboard shortcuts

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