mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
f962d13407
* fix races in committee cache tests * lint * gratuitous defer ClearCache if ClearCache * log warning to avoid failed block processing * gaz * add Clear to cache stubs * fix Clear mistakes * last fake cache fix --------- Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
32 lines
899 B
Go
32 lines
899 B
Go
//go:build fuzz
|
|
|
|
package cache
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state"
|
|
)
|
|
|
|
// 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
|
|
}
|
|
|
|
// Clear is a stub.
|
|
func (c *FakeBalanceCache) Clear() {
|
|
return
|
|
}
|