Skip to content

Commit

Permalink
fix: floating point imprecision
Browse files Browse the repository at this point in the history
  • Loading branch information
cdummett committed May 17, 2024
1 parent 1a863da commit 2c68b84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vega_sim/api/faucet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@

def mint(pub_key: str, asset: str, amount: int, faucet_url: str) -> None:
url = BASE_MINT_URL.format(faucet_url=faucet_url)
# Request a proportion of the maximum faucet amount - this allows for
# cases where requesting the maximum amount would have floating point
# imprecision and the request rejected.
payload = {
"party": pub_key,
"amount": str(int(amount)),
"amount": str(int(0.99 * amount)),
"asset": asset,
}
for i in range(20):
Expand Down

0 comments on commit 2c68b84

Please sign in to comment.