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

Changing 'byte_val' for 'key_val' in the attributes declaration when minting an nft #1485

Open
DiazRock opened this issue Aug 20, 2021 · 0 comments

Comments

@DiazRock
Copy link

Following this example, I created a json file for pass a parameter to a mint nft using the node API.
This is the json file

{
    "asset_manager_address": "0x1ef90fa2ec92a768487e4d8bcea91c70559edc18",
    "deposit_address": "0xbd7ec61d3bdcc82ad43644ec45cb9a2d8c0566c9",
    "document_id": "0xca9a99fc71576ade9e31acb55f2c02de59be9cbb20b3fa7b6de887bad8764e6f",
    "proof_fields": [
                "cd_tree.attributes[0xbbaa573c53fa357a3b53624eb6deab5f4c758f299cffc2b0b6162400e3ec13ee].byte_val",
                "cd_tree.attributes[0xcd35852d8705a28d4f83ba46f02ebdf46daf03638b40da74b9371d715976e6dd].byte_val",
                "cd_tree.attributes[0xe5588a8a267ed4c32962568afe216d4ba70ae60576a611e3ca557b84f1724e29].byte_val",
                "cd_tree.attributes[0xe24e7917d4fcaf79095539ac23af9f6d5c80ea8b0d95c9cd860152bff8fdab17].byte_val",
                "cd_tree.attributes[0xac202291526632eb043339a7e504ac9782636839c37374e96829f650f4a9f1ae].byte_val",
                "signatures_tree.signatures[0x9f5914d3608b692073A6F992c1b93e87d6Ea2252aa6e46f4a7efea36388830ff54439f231111bf03a8728335f85f84487de6bfa6]"
            ]
}

And this the URL for the POST API call
http://localhost:8082/v2/nfts/registries/0xb56ac47948157a7259ac2b72b950193a7fa40f81/mint content-type:application/json authorization:0x075597d5d56f19f14d82023e6879523fbd879542

But debugging the actual version of the code, I founded that the tree that conforms in base to the anchor of the corresponding document, has in its NameIndex field, the attributes with key_label in the end, instead of byte_val. You can try it yourself doing the minting steps, and adding a breakpoint here.
When I tried the json file that I showed before, I got this error:

 "error": "failed to prepare mint request: document proof error: No such field: cd_tree.attributes[0xbbaa573c53fa357a3b53624eb6deab5f4c758f299cffc2b0b6162400e3ec13ee].byte_val in obj"

When I changed the "byte_val" part by "key_label", I did not get that error.

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

1 participant