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

Add /account_balance endpoint #394

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Add /account_balance endpoint #394

merged 4 commits into from
Mar 26, 2024

Conversation

FabijanC
Copy link
Contributor

@FabijanC FabijanC commented Mar 25, 2024

Usage related changes

  • Closes API account_balance has error #393
  • Adds the same /account_balance that existed in Devnet-py, but with added token specifier:
    • GET /account_balance?address=<ADDRESS>&[unit=<WEI|FRI>]
  • Remove /fee_token - nobody's asked for it, it seems to be a remnant from times when ERC20 contracts were not deployed to the same addresses as on mainnet/testnet.
  • Improve GeneralError message

Development related changes

  • Refactor BackgroundDevnet::get_balance to rely on the new endpoint.
  • Refactor existing minting tests:
    • Add /account_balance testing
    • Simplify existing tests

Checklist:

  • Applied formatting - ./scripts/format.sh
  • No linter errors - ./scripts/clippy_check.sh
  • No unused dependencies - ./scripts/check_unused_deps.sh
  • Performed code self-review
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Documented the changes
  • Linked the issues which this PR resolves
  • Checked the TODO section in README.md if this PR resolves it
  • Updated the tests
  • All tests are passing - cargo test

@FabijanC FabijanC changed the title Get account balance Add /account_balance endpoint Mar 25, 2024
@marioiordanov marioiordanov self-requested a review March 25, 2024 16:15
@FabijanC FabijanC merged commit e887a72 into main Mar 26, 2024
1 check passed
@FabijanC FabijanC deleted the get-account-balance branch March 26, 2024 14:01
@FabijanC FabijanC mentioned this pull request Apr 16, 2024
2 tasks
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.

API account_balance has error
2 participants