public void Calling_GetPaidPlanGwei_With_Null_ApiEndPoint_Should_Throw_An_Exception() { etheHelper.GetPaidPlanGwei(null, default).GetAwaiter().GetResult(); }
private async Task SendTransaction(TimestampDao timestamp, double gasPrice, bool isFreePlan, CancellationToken cancellationToken) { var ethSettings = _ethHelper.GetEthSettings(); var estimateGasPrice = gasPrice; var gasStationPrice = isFreePlan ? await _ethHelper.GetFreePlanGwei(ethSettings.GasStationAPIEndpoint, cancellationToken) : await _ethHelper.GetPaidPlanGwei(ethSettings.GasStationAPIEndpoint, cancellationToken); if (gasStationPrice != null && gasStationPrice.Gwei > double.MinValue) { estimateGasPrice = gasStationPrice.Gwei; } if (estimateGasPrice > MaxGwei) { estimateGasPrice = MaxGwei; var message = $"Setting to max transaction price of '{MaxGwei}' Gwei."; _logger.Error(message); } if (isFreePlan) { await SendRawTransaction(timestamp, _basicWeb3, ethSettings.BasicAccountSecretKey, estimateGasPrice, ethSettings); } else { await SendRawTransaction(timestamp, _premiumWeb3, ethSettings.PremiumAccountSecretKey, estimateGasPrice, ethSettings); } }