py-algorand-sdk icon indicating copy to clipboard operation
py-algorand-sdk copied to clipboard

`round_num` and `block` no longer allowed when querying balances

Open BunsanMuchi opened this issue 2 years ago • 4 comments

Subject of the issue

Your environment

py-algorand-sdk 2.0.0

Steps to reproduce

  1. Call the method asset_balances(asset_id, round_num=number) or asset_balances(asset_id, block=number)

Expected behaviour

A balance return at the given block/round number according to the docs: https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/v2client/indexer.html

Actual behaviour

It seems like the method got changed, and doesn't allow for this parameter anymore, I believe it's a case of outdated docs or an undocumented change, since I get the following TypeErrors:

TypeError: IndexerClient.indexer_request() got an unexpected keyword argument 'round_num' TypeError: IndexerClient.indexer_request() got an unexpected keyword argument 'block'

BunsanMuchi avatar Apr 29 '23 21:04 BunsanMuchi

Thanks for identifying this issue. It appears that the docs getting generated are inaccurate and do not conform with the actual v2 API which does not accept block/round number.

This discrepancy ought to be fixed as soon as possible, even though it probably is a longstanding issue.

tzaffi avatar May 01 '23 01:05 tzaffi

Yep, I've noticed it happens with a lot of places on both the SDK and the docs of the SDK. Plus the few methods that still support round_num or block end up with either rewind issues or just printing the current round, leading to confusing results. Thanks!

BunsanMuchi avatar May 01 '23 10:05 BunsanMuchi

If you know off hand other instances, we welcome your feedback.

tzaffi avatar May 01 '23 13:05 tzaffi

The fix didn't make it into today's release, but will go in the next one.

tzaffi avatar May 08 '23 22:05 tzaffi