cache

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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