Giter VIP home page Giter VIP logo

Comments (7)

winder avatar winder commented on August 27, 2024 1

I don't think the server supports setting values to 0, so this bug is more than an SDK/test quirk. The tests are actually enforcing the current server expectations.

from algorand-sdk-testing.

fionnachan avatar fionnachan commented on August 27, 2024 1

@winder
USDC, currency-greater-than=0:
https://algoindexer.algoexplorerapi.io/v2/assets/31566704/balances?currency-greater-than=0
This excludes accounts with 0 balance

USDC, currency-greater-than unset:
https://algoindexer.algoexplorerapi.io/v2/assets/31566704/balances
This includes accounts with 0 balance

But the SDK would not allow the first case currency-greater-than=0 to be queried

from algorand-sdk-testing.

fionnachan avatar fionnachan commented on August 27, 2024 1

Those JS PRs have been sitting there for almost 3 months now.... 👀

from algorand-sdk-testing.

AlgoDoggo avatar AlgoDoggo commented on August 27, 2024

@winder how do you mean? currency-greater-than=0 works as a query string, it accurately filters out accounts who hold 0 of the asset. It only doesn't work with the algosdk but I use it regularly when consuming the indexer api with other libs.

from algorand-sdk-testing.

barnjamin avatar barnjamin commented on August 27, 2024

This is definitely a bug in at least the JS SDK

This section removes valid zeros
https://github.com/algorand/js-algorand-sdk/blob/18b863be6f4fe435b77c75b62316c0a599d88d68/src/client/client.ts#L25-L33

The work around currently is just to set a string "0" so that it makes it through the checks.

This PR I filed last year was to allow searching valid 0s in the indexer: algorand/indexer#484

from algorand-sdk-testing.

winder avatar winder commented on August 27, 2024

Thanks @barnjamin, I forgot about that! I suppose the testing infrastructure and the SDKs would both need to account for this.

from algorand-sdk-testing.

algoanne avatar algoanne commented on August 27, 2024

SDKs need to be able to send 0 for query parameters. There are several transaction endpoints that have this issue/capability.

To solve this, we need to:

  1. audit our endpoints to make sure we solve it for all affected ones.
  2. update our cucumber tests for each affected endpoint.
  3. update each SDK correspondingly (likely all 4 SDKs, but need to confirm that the behavior appears in the Go and Java SDKs as well).

we will complete (1) and (2) as part of this ticket, then (3) with individual tickets for each SDK:

from algorand-sdk-testing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.