public void OrdersByTarget() { var estimations = new Dictionary <int, int> { { 3, 20 }, { 2, 102 }, { 19, 1 }, { 20, 1 } }; var allFee = new AllFeeEstimate(EstimateSmartFeeMode.Conservative, estimations, true); Assert.Equal(estimations[2], allFee.Estimations[2]); Assert.Equal(estimations[3], allFee.Estimations[3]); Assert.Equal(estimations[19], allFee.Estimations[36]); }
public void AllFeeEstimateSerialization() { var estimations = new Dictionary <int, int> { { 2, 102 }, { 3, 20 }, { 19, 1 } }; var allFee = new AllFeeEstimate(EstimateSmartFeeMode.Conservative, estimations); var serialized = JsonConvert.SerializeObject(allFee); var deserialized = JsonConvert.DeserializeObject <AllFeeEstimate>(serialized); Assert.Equal(estimations[2], deserialized.Estimations[2]); Assert.Equal(estimations[3], deserialized.Estimations[3]); Assert.Equal(estimations[19], deserialized.Estimations[19]); Assert.Equal(EstimateSmartFeeMode.Conservative, deserialized.Type); }
public void HandlesOne() { // If there's no 2, this'll be 2. var estimations = new Dictionary <int, int> { { 1, 20 } }; var allFees = new AllFeeEstimate(EstimateSmartFeeMode.Conservative, estimations, true); Assert.Single(allFees.Estimations); Assert.Equal(estimations[1], allFees.Estimations[2]); // If there's 2, 1 is dismissed. estimations = new Dictionary <int, int> { { 1, 20 }, { 2, 21 } }; allFees = new AllFeeEstimate(EstimateSmartFeeMode.Conservative, estimations, true); Assert.Single(allFees.Estimations); Assert.Equal(estimations[2], allFees.Estimations[2]); }
private void SetFees() { AllFeeEstimate allFeeEstimate = Global.FeeProviders?.AllFeeEstimate; if (allFeeEstimate is { })
private void ApplyFees() { AllFeeEstimate allFeeEstimate = _feeProviders?.AllFeeEstimate; if (allFeeEstimate is { })