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

Wrong asset fingerprints #487

Closed
xray-robot opened this issue May 5, 2021 · 4 comments · Fixed by #526
Closed

Wrong asset fingerprints #487

xray-robot opened this issue May 5, 2021 · 4 comments · Fixed by #526
Assignees

Comments

@xray-robot
Copy link

xray-robot commented May 5, 2021

Query

query getTxsInfo($hashes: [Hash32Hex]!) {
  transactions(
    limit: 100
    order_by: { includedAt: desc }
    offset: 0
    where: { hash: { _in: $hashes } }
  ) {
    fee
    hash
    includedAt
    inputs {
      address
      value
      tokens {
        quantity
        asset {
          assetId
          assetName
          description
          fingerprint
          logo
          name
          ticker
          url
          policyId
        }
      }
    }
    outputs {
      address
      value
      tokens {
        quantity
        asset {
          assetId
          assetName
          description
          fingerprint
          logo
          name
          ticker
          url
          policyId
        }
      }
    }
  }
}
{
  "hashes": ["50b49c5fed5fdc5ae5e2e23ebaeed997ec278332c767cfe7dbc33cc93984d5eb"]
}

But none of the asset fingerprints are equal to this data: https://cardanoscan.io/transaction/50b49c5fed5fdc5ae5e2e23ebaeed997ec278332c767cfe7dbc33cc93984d5eb

Any thoughts on that?

@xray-robot
Copy link
Author

For example, a fingerprint of the same asset on cardanoscan is "asset1teq8p9z6zyr4xjswc6u6zk9ppuj75s5h22usgr" and on cardano-graphql is "asset1angnhnhexynlhz0v9e02v65ks9xqtah053fgv". This is wrong.

PolicyId and assetName are correct.

@rhyslbw rhyslbw self-assigned this May 6, 2021
@rhyslbw
Copy link
Contributor

rhyslbw commented May 10, 2021

I just ran the query on my local instance, this is the result:

{
  "data": {
    "transactions": [
      {
        "fee": 229257,
        "hash": "50b49c5fed5fdc5ae5e2e23ebaeed997ec278332c767cfe7dbc33cc93984d5eb",
        "includedAt": "2021-05-05T11:59:06Z",
        "inputs": [
          {
            "address": "addr1q87cwj26ftt8ucu52sw9ravms9h7tuwlzg7pyf8f0ln8xxjylayug87f0fumqe0hkm7hffgczcu68vg7fvntlntdu9esg5dupm",
            "value": "2000000",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653030323336",
                  "assetName": "43727970746f4d6167653030323336",
                  "description": null,
                  "fingerprint": "asset1rmc67v9gxltregz0ejxj8fxcryqwsamawhuvft",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q87cwj26ftt8ucu52sw9ravms9h7tuwlzg7pyf8f0ln8xxjylayug87f0fumqe0hkm7hffgczcu68vg7fvntlntdu9esg5dupm",
            "value": "2000000",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653030323132",
                  "assetName": "43727970746f4d6167653030323132",
                  "description": null,
                  "fingerprint": "asset1teq8p9z6zyr4xjswc6u6zk9ppuj75s5h22usgr",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q87cwj26ftt8ucu52sw9ravms9h7tuwlzg7pyf8f0ln8xxjylayug87f0fumqe0hkm7hffgczcu68vg7fvntlntdu9esg5dupm",
            "value": "2000000",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653035333537",
                  "assetName": "43727970746f4d6167653035333537",
                  "description": null,
                  "fingerprint": "asset183j5z3klm06r9a5pnahfzhn0rlp72qp4a4x2qa",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q87cwj26ftt8ucu52sw9ravms9h7tuwlzg7pyf8f0ln8xxjylayug87f0fumqe0hkm7hffgczcu68vg7fvntlntdu9esg5dupm",
            "value": "2000000",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653031363537",
                  "assetName": "43727970746f4d6167653031363537",
                  "description": null,
                  "fingerprint": "asset1wsunn9ty4sl6my4vtl7qg0pyz4v7363v5dlehl",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q87cwj26ftt8ucu52sw9ravms9h7tuwlzg7pyf8f0ln8xxjylayug87f0fumqe0hkm7hffgczcu68vg7fvntlntdu9esg5dupm",
            "value": "2000000",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653036333538",
                  "assetName": "43727970746f4d6167653036333538",
                  "description": null,
                  "fingerprint": "asset1emkka0jxzs4kq7rdy5czsnqp2kcc0fjclt8cue",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q87cwj26ftt8ucu52sw9ravms9h7tuwlzg7pyf8f0ln8xxjylayug87f0fumqe0hkm7hffgczcu68vg7fvntlntdu9esg5dupm",
            "value": "2000000",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653037353636",
                  "assetName": "43727970746f4d6167653037353636",
                  "description": null,
                  "fingerprint": "asset1c3wwsxdqdxqrcmvx39nus2n02gk70lqd76g63t",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q87cwj26ftt8ucu52sw9ravms9h7tuwlzg7pyf8f0ln8xxjylayug87f0fumqe0hkm7hffgczcu68vg7fvntlntdu9esg5dupm",
            "value": "2000000",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653030343231",
                  "assetName": "43727970746f4d6167653030343231",
                  "description": null,
                  "fingerprint": "asset1qt4sz0qznctyc2avwp93dv9qkv6d97m2stjw7s",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          }
        ],
        "outputs": [
          {
            "address": "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc",
            "value": "1967249",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653037353636",
                  "assetName": "43727970746f4d6167653037353636",
                  "description": null,
                  "fingerprint": "asset1c3wwsxdqdxqrcmvx39nus2n02gk70lqd76g63t",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc",
            "value": "1967249",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653036333538",
                  "assetName": "43727970746f4d6167653036333538",
                  "description": null,
                  "fingerprint": "asset1emkka0jxzs4kq7rdy5czsnqp2kcc0fjclt8cue",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc",
            "value": "1967249",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653035333537",
                  "assetName": "43727970746f4d6167653035333537",
                  "description": null,
                  "fingerprint": "asset183j5z3klm06r9a5pnahfzhn0rlp72qp4a4x2qa",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc",
            "value": "1967249",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653031363537",
                  "assetName": "43727970746f4d6167653031363537",
                  "description": null,
                  "fingerprint": "asset1wsunn9ty4sl6my4vtl7qg0pyz4v7363v5dlehl",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc",
            "value": "1967249",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653030343231",
                  "assetName": "43727970746f4d6167653030343231",
                  "description": null,
                  "fingerprint": "asset1qt4sz0qznctyc2avwp93dv9qkv6d97m2stjw7s",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc",
            "value": "1967249",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653030323336",
                  "assetName": "43727970746f4d6167653030323336",
                  "description": null,
                  "fingerprint": "asset1rmc67v9gxltregz0ejxj8fxcryqwsamawhuvft",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          },
          {
            "address": "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc",
            "value": "1967249",
            "tokens": [
              {
                "quantity": "1",
                "asset": {
                  "assetId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc43727970746f4d6167653030323132",
                  "assetName": "43727970746f4d6167653030323132",
                  "description": null,
                  "fingerprint": "asset1teq8p9z6zyr4xjswc6u6zk9ppuj75s5h22usgr",
                  "logo": null,
                  "name": null,
                  "ticker": null,
                  "url": null,
                  "policyId": "b43131f2c82825ee3d81705de0896c611f35ed38e48e33a3bdf298dc"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

This result includes asset1teq8p9z6zyr4xjswc6u6zk9ppuj75s5h22usgr. Happy to reopen if you can provide an assetId that proves the claim.

@rhyslbw rhyslbw closed this as completed May 10, 2021
@wutzebaer
Copy link

@rhyslbw rhyslbw reopened this Jun 24, 2021
@rhyslbw
Copy link
Contributor

rhyslbw commented Jun 25, 2021

@ray-robot @wutzebaer
Ok yes I can confirm there's a bug with the implementation, specifically when there's no asset name. I'm preparing a fix now

rhyslbw added a commit that referenced this issue Jun 25, 2021
Fixes: #487

- Pass empty string instead of `undefined` when assetName is not present.
- Verified using the CIP test vectors.
- Also runs all tests in `api-cardano-db-hasura`, not just query tests
rhyslbw added a commit that referenced this issue Jun 25, 2021
Fixes: #487

- Pass empty string instead of `undefined` when `assetName` is not present.
- Verified using the CIP test vectors.
- Removes unnecessary jest scoping in `api-cardano-db-hasura` package script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants