-
Notifications
You must be signed in to change notification settings - Fork 35
Update check balance #13
Conversation
|
|
||
| echo "Minting your service on Gnosis chain..." | ||
| ensure_minimum_balance $operator_address $suggested_amount "Please, fund the operator's address with at least $(wei_to_dai $suggested_amount) DAI." | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Adamantios Here I removed the check for the minimum balance of the agent instance address.
run_service.sh
Outdated
| local decimal_precision=4 # Change this to your desired precision | ||
| local dai=$($PYTHON_CMD -c "print('%.${decimal_precision}f' % ($wei / 1000000000000000000.0))") | ||
| echo "$dai DAI" | ||
| echo "$dai" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Functions should do only one thing":
The method was doing 2 things: conversion and formatting.
Now formatting is done in the strings using this function (I added DAI to these strings).
This allows using the output of this function as a number directly, in case it is ever required.
Fix Python version check
A few updates related to checking balance:
Additionally:
This is how it should look like: