Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheIface ¶
type CacheIface interface { GetBalance(account common.Address, chainID uint64, blockNumber *big.Int) *big.Int GetNonce(account common.Address, chainID uint64, blockNumber *big.Int) *int64 AddBalance(account common.Address, chainID uint64, blockNumber *big.Int, balance *big.Int) AddNonce(account common.Address, chainID uint64, blockNumber *big.Int, nonce *int64) BalanceSize(account common.Address, chainID uint64) int NonceSize(account common.Address, chainID uint64) int Clear() }
Interface for cache of balances.
type Cacher ¶
type Cacher interface { BalanceAt(ctx context.Context, client Reader, account common.Address, blockNumber *big.Int) (*big.Int, error) NonceAt(ctx context.Context, client Reader, account common.Address, blockNumber *big.Int) (*int64, error) Clear() Cache() CacheIface }
Cacher interface for caching balance to BalanceCache. Requires BalanceReader to fetch balance.
func NewCacherWithTTL ¶ added in v0.168.1
func NewSimpleCacher ¶ added in v0.168.1
func NewSimpleCacher() Cacher
type Reader ¶
type Reader interface { BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) FullTransactionByBlockNumberAndIndex(ctx context.Context, blockNumber *big.Int, index uint) (*chain.FullTransaction, error) NetworkID() uint64 }
Reader interface for reading balance at a specified address.
type TestCacher ¶ added in v0.172.10
type TestCacher struct {
// contains filtered or unexported fields
}
func (*TestCacher) Cache ¶ added in v0.172.10
func (b *TestCacher) Cache() CacheIface
Click to show internal directories.
Click to hide internal directories.