when collectionID start with 0x0 the payload remove the 0 after x #422
-
Discord user IDspielcrypto Describe your question in detail.I try to set a collection Id calling the function set_config of this module however in the payload the id change removing the 0 after x as is possible to see here sending collection id param to the contract like this What error, if any, are you getting?
What have you tried or looked at? Or how can we reproduce the error?it is explained above in the description Which operating system are you using?Linux (Ubuntu, Fedora, Windows WSL, etc.) Which SDK or tool are you using? (if any)TypeScript SDK Describe your environment or tooling in detailAptos client 4.1.0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Sadly for backwards compatibility reasons a lot of our APIs, tools, etc. do not conform to AIP-40. This means that sometimes certain services, such as the node API, use this incorrect representation where they trim the padding zeroes (AIP-40 says this is only acceptable for special addresses like 0x1). In your case, the data is actually correct on chain, it is just that the node API is converting the data into a string incorrectly (removing the padding zeroes). The explorer (https://explorer.aptoslabs.com/txn/0xf513ab3b2b21951a0bc4f01210eae941b0da7c52c46ae2c01a3dfd7a97e4bee5/payload?network=testnet) is just displaying what the node API returns verbatim (https://fullnode.testnet.aptoslabs.com/v1/transactions/by_hash/0xf513ab3b2b21951a0bc4f01210eae941b0da7c52c46ae2c01a3dfd7a97e4bee5). If the on chain type is We have some ideas for how to fix this, but it's tricky because we also need to not break the API for existing users, even if the current behavior is wrong. @gregnazario might want to chime in with more details. |
Beta Was this translation helpful? Give feedback.
Yeah hopefully we can fix this, but in the near term, I recommend using SDK code to help with this. For example, in Typescript: