github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/cache/proposer_indices_disabled.go (about)

     1  // +build libfuzzer
     2  
     3  // This file is used in fuzzer builds to bypass proposer indices caches.
     4  package cache
     5  
     6  import types "github.com/prysmaticlabs/eth2-types"
     7  
     8  // FakeProposerIndicesCache is a struct with 1 queue for looking up proposer indices by root.
     9  type FakeProposerIndicesCache struct {
    10  }
    11  
    12  // NewProposerIndicesCache creates a new proposer indices cache for storing/accessing proposer index assignments of an epoch.
    13  func NewProposerIndicesCache() *FakeProposerIndicesCache {
    14  	return &FakeProposerIndicesCache{}
    15  }
    16  
    17  // AddProposerIndices adds ProposerIndices object to the cache.
    18  // This method also trims the least recently list if the cache size has ready the max cache size limit.
    19  func (c *FakeProposerIndicesCache) AddProposerIndices(p *ProposerIndices) error {
    20  	return nil
    21  }
    22  
    23  // ProposerIndices returns the proposer indices of a block root seed.
    24  func (c *FakeProposerIndicesCache) ProposerIndices(r [32]byte) ([]types.ValidatorIndex, error) {
    25  	return nil, nil
    26  }
    27  
    28  // HasProposerIndices returns the proposer indices of a block root seed.
    29  func (c *FakeProposerIndicesCache) HasProposerIndices(r [32]byte) (bool, error) {
    30  	return false, nil
    31  }