-
Notifications
You must be signed in to change notification settings - Fork 38
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
Indexer appears to return the AAAA... "zero" address instead of no address at all (e.g. undefined
, null
, or simply absent) for asset information.
#142
Comments
Hmm that seems mainly an API issue. The node's API has this policy (which I dislike) where it omits / expects us to omit values that are considered "zero", which includes arrays with only zeros, or structs with values that are only zeros (this leads to us having to implement "smart" deserialization in some places, like here: algonaut/algonaut_transaction/src/api_model.rs Lines 395 to 415 in 0d93ce1
The indexer sending these zero addresses is also an inconsistency with that. Probably since it uses strings, their serializer doesn't recognize them as a "zero value" and sends it. I'd be inclined to raise the issue in their repo https://github.com/algorand/go-algorand. But not against patching it in the SDK. Edit: this is the indexer's repository: https://github.com/algorand/indexer (ignoring the node's zero values policy, this only affects the indexer). |
We should probably do both, then. (As in, both patching it in the SDK & raising an issue.) Another thing to think about is if we need different deserialization protocols for algod/indexer/kmd. Does anyone know if I can just plop this into the indexer issues? |
Possibly relates to #98? |
Agreed.
If with protocols you mean JSON / MessagePack, For algod/indexer/kmd only JSON should be enough - MessagePack is used only to send transactions and TEAL. Currently
It's a bit wider, but yeah it relates. |
Also relates to #106 |
Describe the bug
The semantics of
Option<Address>
seems invalid for assets.To Reproduce
Attempting to get the json from https://algoindexer.testnet.algoexplorerapi.io/v2/assets/78377817 yields:
The freeze and clawback addresses were set to
None
on creation.As a result, calling
indexer.asset_info
yields the following (truncated for brevity).Apparently, attempting to create an asset with the AAAA... address yields an error.... which means that the zero address actually means "missing address".
Expected behavior
I was expecting:
Additional context
I personally think that
algonaut
should understand these zero addresses and parse them as "None"s. This obviously introduces complexities and potential bug in the future if existing behavior ever changes.The other option is to leave them alone, but get rid of the
Option
from the various addresses. I don't like this.Regardless of what happens, this behavior is mildly janky and should be documented.
The text was updated successfully, but these errors were encountered: