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

Expose min-balance field in **Account Info** #286

Closed
tzaffi opened this issue Dec 17, 2021 · 8 comments · Fixed by #715
Closed

Expose min-balance field in **Account Info** #286

tzaffi opened this issue Dec 17, 2021 · 8 comments · Fixed by #715
Assignees

Comments

@tzaffi
Copy link
Contributor

tzaffi commented Dec 17, 2021

Problem

min-balance is available in algod but not in the Java SDK.

Solution

algorand/go-algorand#3287 has introduced min-balance to the response of algod's /v2/accounts/{{ACCOUNT}} as well as to the goal account info.

  • When querying the REST API avove, expose the min-balance field
  • Pass appropriate cucumber tests

Dependencies

Urgency

Low

@ghost
Copy link

ghost commented Mar 9, 2022

Is it okay if I can take a stab at this?

I am wondering how to effectively update the sdk-testing repo and the individual repos for cucumber test changes. Is the idea is to push the changes to all repo at once?

  1. If we change cucumber test in algorand-sdk-testing to include the new parameter then we have to change the signature of the function in all the language specific sdks or the tests will start failing due to signature mismatch.

https://github.com/algorand/algorand-sdk-testing/blob/c306203d1f7bb2f1c4cc90c96256c9db60de6504/features/integration/indexer.feature#L147-L150

  1. The reverse is also true. We cannot update the language specific sdk integration test without updating the algorand-sdk-testing repo.

@Then("There are {int}, the first has {long}, {long}, {long}, {long}, {string}, {long}, {string}, {string}")
public void there_are_the_first_has(Integer numAccounts, Long pendingRewards, Long rewardsBase, Long rewards, Long amountWithoutPendingRewards, String address, Long amount, String status, String type) {
AccountsResponse response = accountsResponse.body();

@tzaffi
Copy link
Contributor Author

tzaffi commented Mar 9, 2022

That's a good point. You can add a new cucumber test together with a filter label (something like @accounts.min-balance) and then only run the test in the SDK that you have implemented. In that way, you won't break any of the other SDK's.

@ghost
Copy link

ghost commented Mar 11, 2022

@tzaffi Thank you!

I am not working on this anymore.

@jds1g14
Copy link

jds1g14 commented Apr 28, 2022

Hey @tzaffi , quick question regarding this. When we refer to the /v2/accounts/{{ACCOUNT}} REST call above which are we referring to ?

/v2/accounts/{address} - algod
/v2/accounts/{account-id} - indexer

Based on what you've said above, as well as having looked at the swaggers I believe the change needs to be made for algod, however the person who last worked on this has suggested making changes in the Indexer response

@tzaffi
Copy link
Contributor Author

tzaffi commented Apr 28, 2022

hi @jds1g14 - this issue when it was created was to provide min-balance functionality in the Java SDK, via algod. However, I expect that in a couple of weeks, indexer will be providing min-balance as well. Depending on the timing of when this issue is addressed, it may be possible to address the indexer functionality in the Java SDK as well. But technically, it's outside the scope of this issue. I Would probably create new issues when min-balance becomes available for indexer.

@jds1g14
Copy link

jds1g14 commented Apr 28, 2022

Perfect, I'll start work on this.

  1. Create/modify any existing tests and response files in algorand-sdk-testing, adding an appropriate tag
  2. Update model in java-algorand-sdk

@winder
Copy link
Contributor

winder commented Apr 11, 2023

I wonder why this isn't autogenerated. It appears to be in the OpenAPI spec: https://github.com/algorand/go-algorand/blob/master/daemon/algod/api/algod.oas2.json#L2466

@winder
Copy link
Contributor

winder commented Apr 12, 2023

It's because Account is shared between the OpenAPI spec in go-algorand and Indexer, but the Indexer version is used to generate the model types. The Indexer spec doesn't include min-balance because that feature was never added to Indexer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants