blocknetdx / exrproxy-env

erp-ethserver
7 stars 10 forks source link

[Bug] Entering a non-integer for the payment amount in builder.py results in an error #204

Closed shrnkld closed 1 year ago

shrnkld commented 2 years ago

Entering any non-integer value for tierX_payment_amount crashes builder.py

Steps to reproduce:

  1. during the builder.py process the user is presented with the following question: Press enter for 0USD tier1 amount or type a new USD price:
  2. entering any non-integer eg 0.5 results in:
    Traceback (most recent call last):
    File "./builder.py", line 243, in <module>
    b['payment_tier1'] = int(tier1) if tier1 !='' else b["payment_tier1"]
    ValueError: invalid literal for int() with base 10: '0.5'
    Closing...

To do:

tier1 = snode.inquirer.get_input(f'Press enter for {b["payment_tier1"]}USD tier1 amount or type a new USD price:')
                    b['payment_tier1'] = int(tier1) if tier1 !='' else b["payment_tier1"]
                    tier2 = snode.inquirer.get_input(f'Press enter for {b["payment_tier2"]}USD tier2 amount or type a new USD price:')
                    b['payment_tier2'] = int(tier2) if tier2 !='' else b["payment_tier2"]

QA:

ConanMishler commented 1 year ago

@shrnkld I've tested for this bug in the latest Projects API and it looks like it has been fixed. Shall we go ahead and close it, or do you want to test it yourself first?

shrnkld commented 1 year ago

I'll check it too @ConanMishler and close it when i've reviewed it ;)

thanks for the update.