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

Changes the accounts_balances RPC to return per account results #3790

Merged
merged 4 commits into from Apr 19, 2022

Conversation

thsfs
Copy link
Contributor

@thsfs thsfs commented Apr 13, 2022

The previous implementation returned only an error result in case any of the accounts were invalid. This implementation now handles each account separately returning per account results.

    "balances": {
        "nano_3wfddg7a1paogrcwi3yhwnaerboukbr7rs3z3ino5toyq3yyhimo6f6egij6": {
            "balance": "442000000000000000000000000000",
            "pending": "0",
            "receivable": "0"
        },
        "nano_36uccgpjzhjsdbj44wm1y5hyz8gefx3wjpp1jircxt84nopxkxti5bzq1rnz": {
            "error": "Bad account number"
        },
        "nano_1hrts7hcoozxccnffoq9hqhngnn9jz783usapejm57ejtqcyz9dpso1bibuy": {
            "error": "Account not found"
        }
    }

Reference issue: #3752

@thsfs thsfs added this to the V24.0 milestone Apr 13, 2022
@thsfs thsfs added the rpc Changes related to Remote Procedure Calls label Apr 13, 2022
clemahieu
clemahieu previously approved these changes Apr 14, 2022
@zhyatt
Copy link
Collaborator

zhyatt commented Apr 14, 2022

Since we are doing Account not found error in some of the other responses when the account hasn't been opened, such as in #3789 , should we also do that here instead of 0 values? @clemahieu @thsfs @dsiganos

        "nano_1hrts7hcoozxccnffoq9hqhngnn9jz783usapejm57ejtqcyz9dpso1bibuy": {
            "error": "Account not found"
        },

@thsfs
Copy link
Contributor Author

thsfs commented Apr 14, 2022

Since we are doing Account not found error in some of the other responses when the account hasn't been opened, such as in #3789 , should we also do that here instead of 0 values? @clemahieu @thsfs @dsiganos

        "nano_1hrts7hcoozxccnffoq9hqhngnn9jz783usapejm57ejtqcyz9dpso1bibuy": {
            "error": "Account not found"
        },

It makes sense to me to have the same type of error response when the account is not found.

@dsiganos
Copy link
Contributor

This RPC should also be taking include_only_confirmed as option.
Like account_balance does. But that could be a different PR.

@thsfs thsfs merged commit 580c3c1 into develop Apr 19, 2022
@thsfs thsfs deleted the accounts_balances_per_item_response branch April 19, 2022 12:37
@thsfs thsfs added the documentation This item indicates the need for or supplies updated or expanded documentation label Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This item indicates the need for or supplies updated or expanded documentation rpc Changes related to Remote Procedure Calls
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants