Documentation ¶
Index ¶
- type Cache
- func (b *Cache) AddBalance(account common.Address, chainID uint64, blockNumber *big.Int, balance *big.Int)
- func (b *Cache) AddNonce(account common.Address, chainID uint64, blockNumber *big.Int, nonce *int64)
- func (b *Cache) BalanceAt(ctx context.Context, client Reader, account common.Address, ...) (*big.Int, error)
- func (b *Cache) Cache() CacheIface
- func (b *Cache) Clear()
- func (b *Cache) GetBalance(account common.Address, chainID uint64, blockNumber *big.Int) *big.Int
- func (b *Cache) GetNonce(account common.Address, chainID uint64, blockNumber *big.Int) *int64
- func (b *Cache) NonceAt(ctx context.Context, client Reader, account common.Address, ...) (*int64, error)
- type CacheIface
- type Cacher
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) AddBalance ¶
func (*Cache) Cache ¶
func (b *Cache) Cache() CacheIface
func (*Cache) GetBalance ¶
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) 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.
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.
Click to show internal directories.
Click to hide internal directories.