algorand / algorand/indexer

Unable to filter some transactions where numerical fields are the value 0

Abierto
#1,668 2 comentarios 0 reacciones 0 asignados Ver en GitHub
new-bug
Lenguaje dominante
Go
Estrellas
116
Forks
95
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Subject of the issue

If you search for transactions without certain filters, the result will include transactions where certain fields are 0 (amount, asset-id, application-id). But if you attempt to filter for those transactions, they seem to disappear for some fields.

### Steps to reproduce

Finding asset transfers where amount is 0.
```
# Count number of axfer transactions in block 47171361, filtering for amount==0 in jq.
nullun ~ % curl -s "https://mainnet-idx.algonode.cloud/v2/transactions?round=47171361&tx-type=axfer" | jq '.transactions | map(select(."asset-transfer-transaction".amount == 0)) | length'
16

# Count number of axfer transactions in block 47171361, filtering for currency-less-than=1 in URL.
nullun ~ % curl -s "https://mainnet-idx.algonode.cloud/v2/transactions?round=47171361&tx-type=axfer¤cy-less-than=1" | jq '.transactions | map(select(."asset-transfer-transaction".amount == 0)) | length'
0
```

Looking for application creations, where application-id is 0.
```
# Count number of appl transactions in block 49725523, filtering for application-id==0 in jq.
nullun ~ % curl -s "https://mainnet-idx.algonode.cloud/v2/transactions?round=49725523&tx-type=appl" | jq '.transactions | map(select(."application-transaction"."application-id" == 0)) | length'
1

# Count number of appl transactions in block 49725523, filtering for application-id==0 in URL.
nullun ~ % curl -s "https://mainnet-idx.algonode.cloud/v2/transactions?round=49725523&tx-type=appl&application-id=0" | jq '.transactions | map(select(."application-transaction"."application-id" == 0)) | length'
0
```

But interestingly, if you look for asset transfers, where asset-id is 0. This does work correctly.
```
# Count number of axfer transactions in block 47171361, filtering for asset-id==0 in jq.
nullun ~ % curl -s "https://mainnet-idx.algonode.cloud/v2/transactions?round=47171361&tx-type=axfer" | jq '.transactions | map(select(."asset-transfer-transaction"."asset-id" == 0)) | length'
1

# Count number of axfer transactions in block 47171361, filtering for asset-id==0 in URL.
nullun ~ % curl -s "https://mainnet-idx.algonode.cloud/v2/transactions?round=47171361&tx-type=axfer&asset-id=0" | jq '.transactions | map(select(."asset-transfer-transaction"."asset-id" == 0)) | length'
1
```

### Your environment

This is consistent on all networks at the moment, including a local sandbox environment building from source.

### Expected behaviour

I would probably expect transactions where a field is 0 to be returned if I'm searching for transactions where the field is 0. E.g. Looking for asset optin transactions where amount is zero. Or looking for applications being created since their application-id didn't exist when sending.

### Actual behaviour

Some transactions that were committed to the chain with certain fields containing the value 0 are not returned when filtering for them.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.