Пример #1
0
        public async Task FinishInitialSync_Test()
        {
            int  chainId   = _chainOptions.ChainId;
            long libHeight = 10;

            _crossChainTestHelper.SetFakeLibHeight(libHeight);
            _crossChainTestHelper.AddFakeParentChainIdHeight(chainId, libHeight);
            await _crossChainService.FinishInitialSyncAsync();

            var info = _crossChainService.GetNeededChainIdAndHeightPairs();

            Assert.Contains(chainId, info.Keys);
            Assert.Contains(libHeight + 1, info.Values);
        }
Пример #2
0
 public async Task RequestCrossChainDataFromOtherChainsAsync()
 {
     var chainIdHeightDict = _crossChainService.GetNeededChainIdAndHeightPairs();
     
     foreach (var chainIdHeightPair in chainIdHeightDict)
     {
         Logger.LogTrace(
             $"Try to request from chain {ChainHelper.ConvertChainIdToBase58(chainIdHeightPair.Key)}, from height {chainIdHeightPair.Value}");
         await _crossChainClientService.RequestCrossChainDataAsync(chainIdHeightPair.Key, chainIdHeightPair.Value);
     }
 }