public void RegisterNewChainTest() { var chainId = 1; _crossChainCacheEntityService.RegisterNewChain(chainId, 1); var cachedChainIdList = _crossChainCacheEntityService.GetCachedChainIds(); cachedChainIdList.ShouldContain(chainId); _crossChainCacheEntityService.GetCachedChainIds(); var targetHeight = _crossChainCacheEntityService.GetTargetHeightForChainCacheEntity(chainId); targetHeight.ShouldBe(2); }
public Dictionary <int, long> GetNeededChainIdAndHeightPairs() { var chainIdList = _crossChainCacheEntityService.GetCachedChainIds(); var dict = new Dictionary <int, long>(); foreach (var chainId in chainIdList) { var neededChainHeight = _crossChainCacheEntityService.GetTargetHeightForChainCacheEntity(chainId); dict.Add(chainId, neededChainHeight); } return(dict); }
private Dictionary <int, long> GetNeededChainIdAndHeightPairs() { var chainIdList = _crossChainCacheEntityService.GetCachedChainIds(); var dict = new Dictionary <int, long>(); foreach (var chainId in chainIdList) { var neededChainHeight = _crossChainCacheEntityService.GetTargetHeightForChainCacheEntity(chainId); if (neededChainHeight < AElfConstants.GenesisBlockHeight) { continue; } dict.Add(chainId, neededChainHeight); } return(dict); }