Skip to content

Changes the accounts_balances RPC to return per account results#3790

Merged
thsfs merged 4 commits intodevelopfrom
accounts_balances_per_item_response
Apr 19, 2022
Merged

Changes the accounts_balances RPC to return per account results#3790
thsfs merged 4 commits intodevelopfrom
accounts_balances_per_item_response

Conversation

@thsfs
Copy link
Copy Markdown
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 requested review from clemahieu, dsiganos and zhyatt April 13, 2022 13:23
@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants