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

Trust line counted in /assets when not authorized #1933

Closed
bartekn opened this issue Nov 15, 2019 · 4 comments
Closed

Trust line counted in /assets when not authorized #1933

bartekn opened this issue Nov 15, 2019 · 4 comments
Assignees
Labels

Comments

@bartekn
Copy link
Contributor

bartekn commented Nov 15, 2019

horizon-cmp found the following diff:

      {
        "_links": {
          "toml": {
            "href": "https://horizon.singularity.exchange/.well-known/stellar.toml"
          }
        },
        "asset_type": "credit_alphanum4",
        "asset_code": "BTC",
        "asset_issuer": "GB7ZHXCNHG5IMEHIS2MG54DR3QJIPAQIBFBKZDMCHSDLJYNJNZXKS4SO",
>        "paging_token": "BTC:GB7ZHXCNHG5IMEHIS2MG54DR3QJIPAQIBFBKZDMCHSDLJYNJNZXKS4SO",
<        "paging_token": "BTC_GB7ZHXCNHG5IMEHIS2MG54DR3QJIPAQIBFBKZDMCHSDLJYNJNZXKS4SO_credit_alphanum4",
        "amount": "90029991.0000000",
>        "num_accounts": 12,
<        "num_accounts": 9,
        "flags": {
          "auth_required": true,
          "auth_revocable": true,
          "auth_immutable": false
        }
      },

The first issue is that paging_token format has changed and I think it's fine because it's value shouldn't be interpreted in any way and just used.

The bigger problem is num_accounts value. It seems that the old code does not count not authorized (flag) trust lines to accounts with auth_required=true.

@ire-and-curses
Copy link
Member

This is interesting. There was a SE question yesterday where the author said:

Ideally I would like to get a list of accounts that are authorized to hold your asset and also a list of accounts that have "applied" for a trustline to hold your asset via Horizon.

num_accounts seems a bit ambiguous in this context, since it could refer to either authorised trustlines, non-authorised trustlines, or both. It would be great if there was a way to disambiguate.

@abuiles
Copy link
Contributor

abuiles commented Nov 15, 2019

@ire-and-curses I think we could also add an extra param to /accounts - to return either authorized or unauthorized. It returns all by default.

?asset_authorized=0 & ?asset_authorized=1

@bartekn
Copy link
Contributor Author

bartekn commented Nov 15, 2019

Can you create a new issue for this? I think it's quite easy to do so maybe we could add it to 0.24.0 milestone. This issue is to just make sure /assets returns the same response as 0.22.2.

@bartekn
Copy link
Contributor Author

bartekn commented Nov 15, 2019

Closed in #1936.

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

No branches or pull requests

4 participants