Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix balance comparison to zero test #4240

Merged
merged 11 commits into from
Apr 22, 2024
Merged

Conversation

elmattic
Copy link
Contributor

@elmattic elmattic commented Apr 19, 2024

Summary of changes

Changes introduced in this pull request:

  • Add the same flags for forest-wallet balance as forest-wallet list
  • Fix wallet send check script

Example:

$ ./forest-wallet list                                             
Address                                   Default Balance
t1crmjzblza7nvhxbpvy2gps7oobypoqbn6ubttwa  X        ~100 FIL
t1e2n3hw3jbbzivjmozqhbh6kd5xktfczqj7fs4xy           500 nanoFIL
t1wlfkoqqh2xqlxj2uew66fmj6s4iobzonal6r64q           0 FIL
$ ./forest-wallet balance t1crmjzblza7nvhxbpvy2gps7oobypoqbn6ubttwa -e 
99999998785327636640 attoFIL

By design, an empty wallet will always print 0 FIL.

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@elmattic elmattic marked this pull request as ready for review April 19, 2024 12:20
@elmattic elmattic requested a review from a team as a code owner April 19, 2024 12:20
@elmattic elmattic requested review from hanabi1224 and LesnyRumcajs and removed request for a team April 19, 2024 12:20
@aatifsyed aatifsyed added this pull request to the merge queue Apr 19, 2024
@elmattic elmattic removed this pull request from the merge queue due to a manual request Apr 19, 2024
@elmattic elmattic enabled auto-merge April 20, 2024 15:30
i=$((i+1))

: "Checking balance $i/20"
sleep 30s
ADDR_TWO_BALANCE=$($FOREST_WALLET_PATH balance "$ADDR_TWO")
ADDR_TWO_BALANCE=$($FOREST_WALLET_PATH balance "$ADDR_TWO" -e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use long flag unless it obvious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

/// Output is rounded to 4 significant figures by default.
/// Do not round
// ENHANCE(aatifsyed): add a --round/--no-round argument pair
#[arg(long, alias = "exact-balance", short_alias = 'e')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd omit short flags unless it's very obvious, e.g., -i for interactive or -f to force.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

@elmattic elmattic added this pull request to the merge queue Apr 22, 2024
Merged via the queue into main with commit 3c7111d Apr 22, 2024
27 checks passed
@elmattic elmattic deleted the elmattic/fix-calibnet-wallet-check branch April 22, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants