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

get_balance fails when account doesn't exist #9

Closed
evgenykuzyakov opened this issue Jun 1, 2020 · 1 comment
Closed

get_balance fails when account doesn't exist #9

evgenykuzyakov opened this issue Jun 1, 2020 · 1 comment
Assignees

Comments

@evgenykuzyakov
Copy link

assert(balanceRegistry.contains(owner_id), ERR_INVALID_ACCOUNT)

Why does the implementation need to fail instead of returning 0?

If you write a contract that checks balance of a user, you now need to handle 2 cases. Does the response failed or returned a value. Instead of always succeed and rerturn.

@chadoh chadoh self-assigned this Jun 1, 2020
@idea404
Copy link
Contributor

idea404 commented Jun 2, 2022

Examples now in Rust and do return 0 when an account is not registered with the ft_contract

@idea404 idea404 closed this as completed Jun 2, 2022
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

No branches or pull requests

3 participants