This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Incorrect processing of updates of the storage collection that stores empty tuples #14651
Open
Description
Is there an existing issue?
- I have searched the existing issues
Experiencing problems? Have you tried our Stack Exchange first?
- This is not a support question.
Description of bug
Issues:
- Requests for storage items provide wrong values if a collection stores "empty tuple" / "no record".
- Substrate node doesn't provide updates over WS for changes in such collections.
Steps to reproduce provided below.
Collection "Account" of the pallet "uniques" stores "empty tuple" / "no record".
substrate/frame/uniques/src/lib.rs
Line 180 in cb450b6
Another collection "Asset" of the same pallet stores a struct. And for "Asset" all works fine.
substrate/frame/uniques/src/lib.rs
Line 208 in cb450b6
Seems there are some issues with the Substrate internal logic or API that arise when we request data for the collection that stores empty tuple.
We have the same issue with our own app that communicates with the blockchain node directly.
So it's not a bug in PolkadotJS.
Steps to reproduce
Precondition
- Select Kusama assets hub, pallet "uniques"
- create an NFT collection, mint several tokens in this collection
Scenario
- open PolkadotJS
- open Developer -> Chain state
- select "uniques", "account". Provide params: accountID, collection ID, item ID
- make a request. The result will be
null
, means the record with given keys exist and account owns the token - transfer NFT token to another address via any other app
- record displayed by the PolkadotJS should switch to
<none>
- means there is no record with the given keys. But this doesn't happen. - make one more request with the same params: accountID, collection ID, item ID. The result is still
null
instead of<none>
- make a request without an optional param ItemID - the list of tokens owned by AccountID in the provided CollectionID doesn't include the token been sent on previous step, as expected.
Activity