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

Invalid pointer key in names/owned_by #1665

Open
davidyuk opened this issue Jan 11, 2024 · 5 comments
Open

Invalid pointer key in names/owned_by #1665

davidyuk opened this issue Jan 11, 2024 · 5 comments
Assignees

Comments

@davidyuk
Copy link
Member

I've claimed a name testtesttesttest.chain on testnet and set a pointer with key 0 to ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ.

// 20240111191727
// https://testnet.aeternity.io/v3/names/testtesttesttest.chain
{
  "id": "nm_23VeJoefV7S7S2TGsDZ9mjUWVTiTHuEHUpujcDeoksCVdhqrxS",
  "owner": "ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ",
  "pointers": [
    {
      "id": "ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ",
      "key": "0"
    }
  ],
  "ttl": 1066558
}

When I'm requesting names owned by this account I'm getting in response

// 20240111191711
// https://testnet.aeternity.io/mdw/names/owned_by/ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ
{
  "active": [
    {
      "active": true,
      "auction": null,
      "hash": "nm_23VeJoefV7S7S2TGsDZ9mjUWVTiTHuEHUpujcDeoksCVdhqrxS",
      "info": {
        "active_from": 886547,
        "approximate_expire_time": 1736751634680,
        "auction_timeout": 0,
        "claims": [
          38094493
        ],
        "expire_height": 1066558,
        "ownership": {
          "current": "ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ",
          "original": "ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ"
        },
        "pointers": {
          "MA==": "ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ"
        },
        "revoke": null,
        "transfers": [
          
        ],
        "updates": [
          38094661,
          38094510
        ]
      },
      "name": "testtesttesttest.chain",
      "previous": [
        
      ],
      "status": "name"
    },
    ...

For some reason, 0 became MA== in middleware response 🤷‍♀️

@sborrazas
Copy link
Contributor

@davidyuk the keys in the pointers object are always base64-encoded, because they may be binaries

@sborrazas sborrazas self-assigned this Jan 22, 2024
@davidyuk
Copy link
Member Author

davidyuk commented Jan 24, 2024

but these keys are not encoded in the node's implementation (see first response), can you make it consistent with it?

// 20240124180629
// https://testnet.aeternity.io/mdw/names/owned_by/ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ
{
  "active": [
    {
        // ...
        "pointers": {
          "account_pubkey": "ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ"
        },
        // ...
    },
    {
        // ...
        "pointers": {
          "MA==": "ak_2swhLkgBPeeADxVTAVCJnZLY5NZtCFiM93JxsEaMuC59euuFRQ"
        },
        // ...
    },
  ],
  "top_bid": [
    
  ]
}

keys in the pointers object are always base64-encoded

what about account_pubkey then?

@thepiwo
Copy link
Collaborator

thepiwo commented Mar 20, 2024

@davidyuk how does the node expose binary pointer keys

@davidyuk
Copy link
Member Author

davidyuk commented Mar 26, 2024

They adds ���� where necessary 🤷‍♀️ I've created aeternity/aeternity#4317. Let's wait till they resolve that issue. And after that, make sure the implementation is consistent.

@davidyuk
Copy link
Member Author

So, node implemented the raw bytes support in keys, please, do it the same way 🙂

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

No branches or pull requests

3 participants