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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }