protected void CreateFakeCache(Dictionary <int, BlockInfoCache> cachingData) { foreach (var(key, value) in cachingData) { MultiChainBlockInfoCacheProvider.AddBlockInfoCache(key, value); } }
public void RegisterNewChainCache(int remoteChainId, long chainHeight = KernelConstants.GenesisBlockHeight) { if (!_multiChainBlockInfoCacheProvider.ContainsChain(remoteChainId)) { _multiChainBlockInfoCacheProvider.AddBlockInfoCache(remoteChainId, new BlockInfoCache(chainHeight)); } }
public void TryAdd_NULL() { int chainId = 123; _multiChainBlockInfoCacheProvider.AddBlockInfoCache(chainId, null); Assert.True(_multiChainBlockInfoCacheProvider.Size == 0); }