public async Task <bool> CanExecuteAsync(RewardType rewardType) { var amount = _amountHelper.GetAmount(rewardType); var response = await _nodeApi.GetInfoAsync(); if (response.Result.Balance > amount) { return(true); } return(false); }
public async Task WaitUntilSyncedAsync() { bool isSynced = false; while (!isSynced) { var explorerBlock = await _explorerApi.GetLastBlock(); var getInfo = await _nodeApi.GetInfoAsync(); if (getInfo.Result.Blocks >= explorerBlock) { isSynced = true; _logger.Information("Node is synced."); } else { _logger.Information($"Waiting for node sync: ({getInfo.Result.Blocks} / {explorerBlock})"); await Task.Delay(30000); } } }
public async Task GetInfo_Should_ReturnData() { var result = await _nodeApi.GetInfoAsync(); Assert.NotNull(result); }