oreoshake / hackerone-client

An unofficial wrapper for the HackerOne API
https://api.hackerone.com/docs/v1
MIT License
55 stars 27 forks source link

Changed bounty amount parser to allow floats #44

Closed rzhade3 closed 4 years ago

rzhade3 commented 4 years ago

Currently, the bounty_amount object on H1 is returned as a float, while previously it was a int. As such, the previous way we used to parse these numbers was insufficient, and led to a bug of the amount being off by a factor of 100:

bounty_amount: 500.00
Expected: 500
  Actual: 50000

This PR makes the gsub filters less stringent to allow a decimal point to pass through, and casts to float instead of to int.

oreoshake commented 4 years ago

I can't remember the name for this strategy

Apparently, these are just methods defined in Kernel that have nothing to do with the underlying objects they create, they just happen to share a name.