2022-03-14 20:58:13 +00:00
|
|
|
//go:build fuzz
|
2021-08-26 14:32:40 +00:00
|
|
|
|
|
|
|
package cache
|
|
|
|
|
|
|
|
import (
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
|
2021-08-26 14:32:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// FakeBalanceCache is a fake struct with 1 LRU cache for looking up balance by epoch.
|
|
|
|
type FakeBalanceCache struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewEffectiveBalanceCache creates a new effective balance cache for storing/accessing total balance by epoch.
|
|
|
|
func NewEffectiveBalanceCache() *FakeBalanceCache {
|
|
|
|
return &FakeBalanceCache{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddTotalEffectiveBalance adds a new total effective balance entry for current balance for state `st` into the cache.
|
|
|
|
func (c *FakeBalanceCache) AddTotalEffectiveBalance(st state.ReadOnlyBeaconState, balance uint64) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get returns the current epoch's effective balance for state `st` in cache.
|
|
|
|
func (c *FakeBalanceCache) Get(st state.ReadOnlyBeaconState) (uint64, error) {
|
|
|
|
return 0, nil
|
|
|
|
}
|
2023-04-27 00:50:04 +00:00
|
|
|
|
|
|
|
// Clear is a stub.
|
|
|
|
func (c *FakeBalanceCache) Clear() {
|
|
|
|
return
|
|
|
|
}
|