stacks-core
stacks-core copied to clipboard
nft-burn? returns unexpected error u1
Describe the bug
The documentation says the following for nft-burn?
(https://docs.stacks.co/write-smart-contracts/language-functions#nft-burn)
If an asset identified by asset-identifier doesn't exist, this function will return an error with the following error code: (err u1)
However, calling nft-burn? with tx-sender who does not own the nft returns (err u1) even if the asset exists.
Steps To Reproduce
Clone the repo and run clarinet test
burn nft by owner https://github.com/Light-Labs/ryder-nft/blob/1708febcc0339955752951b809e35d9dfdf6573f/backend-stacks/tests/ryder-nft_test.ts#L97 ==> succeeds
burn nft by user that does not own the existing id https://github.com/Light-Labs/ryder-nft/blob/1708febcc0339955752951b809e35d9dfdf6573f/backend-stacks/tests/ryder-nft_test.ts#L114 ==> burn fails (test successful)
Expected behavior Any tx-sender can call nft-burn? if the contract supports it
This is a documentation bug. Also, code in next
has been updated to use clearer variable names to better indicate the error condition being triggered.
Assigning to @obycode for the time being. Please feel free to re-assign.
This has been updated in the repo and shows correctly on the docs site:
(err u1) -- sender does not own the specified asset