Skip to content

Commit d66a272

Browse files
author
Alan Christie
committed
fix: Now displays coin discrepancy if they do not match
1 parent 3f0030e commit d66a272

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tools/coins.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def main(c_args: argparse.Namespace) -> None:
158158

159159
invoice["Prediction"] = {
160160
"Coins (Burn Rate)": str(burn_rate),
161-
"Coins (Burn Rate Contribution)": f"{remaining_days} x {burn_rate} = {burn_rate_contribution}",
161+
"Coins (Expected Burn Rate Contribution)": f"{remaining_days} x {burn_rate} = {burn_rate_contribution}",
162162
"Coins (Additional Spend)": f"{total_uncommitted_processing_coins} + {burn_rate_contribution} = {additional_coins}",
163163
"Coins (Total Raw)": f"{total_coins} + {additional_coins} = {predicted_total_coins}",
164164
"Coins (Penalty Free)": str(p_ac.fc),
@@ -176,9 +176,15 @@ def main(c_args: argparse.Namespace) -> None:
176176
console.log(f"Product response billing prediction is {product_response_billing_prediction}")
177177

178178
if calculated_billing_prediction == product_response_billing_prediction:
179-
console.log(":white_check_mark: CORRECT - Billing predictions match")
179+
console.log(":white_check_mark: CORRECT - Predictions match")
180180
else:
181-
console.log(":cross_mark: ERROR - Billing predictions do not match")
181+
discrepancy: Decimal = abs(calculated_billing_prediction - product_response_billing_prediction)
182+
if calculated_billing_prediction > product_response_billing_prediction:
183+
who_is_higher: str = "Calculated"
184+
else:
185+
who_is_higher: str = "Product response"
186+
console.log(":cross_mark: ERROR - Predictions do not match.")
187+
console.log(f"There's a discrepancy of {discrepancy} and the {who_is_higher} value is higher.")
182188
sys.exit(1)
183189

184190

0 commit comments

Comments
 (0)