-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nft owner mapping from nft readable state (#10488)
This PR fixes nft owner mapping returned from readable kv states: Modularized services expects the owner of the nft to be null when the owner is the token treasury and return the owner id when the owner is different than the token treasury. This can be verified by the burn nft logic and nft docs: private boolean treasuryOwnsNft(final AccountID ownerID) { return ownerID == null; } * @param ownerId <b>(2)</b> The account or contract id that owns this NFT. * <p> * If this NFT is owned by its token type's current treasury account, * this value SHALL be zero. In order to make it work according to the docs the following change is applied: NftReadableKVState - add tokenRepository to be able to get the treasury of the token. After obtaining the treasury of the token we verify that the nft owner is different than the token treasury. If it is different the we return it otherwise we return null as the docs suggests. NftReadableKVState - adds new checks for token owner and treasury NftReadableKVStateTest - modify according to new changes --------- Signed-off-by: Kristiyan Selveliev <[email protected]>
- Loading branch information
1 parent
8904707
commit 1ffbbb5
Showing
5 changed files
with
101 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters