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

storage: handle NULL NFT owner #570

Merged
merged 1 commit into from
Nov 22, 2023
Merged

storage: handle NULL NFT owner #570

merged 1 commit into from
Nov 22, 2023

Conversation

pro-wh
Copy link
Collaborator

@pro-wh pro-wh commented Nov 22, 2023

we only set owner on transfers, so when we see e.g. Approval, we can add an NFT to the db without setting an owner (hm, but anyway). prevent the storage glue from breaking (attempts to scan NULL into owner address context identifier string) when viewing these entries

@pro-wh pro-wh added the api-layer API layer-related issues. label Nov 22, 2023
@pro-wh pro-wh force-pushed the pro-wh/bugfix/nullowner branch from 2dd2639 to 48bc254 Compare November 22, 2023 00:13
Copy link
Contributor

@mitjat mitjat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -1579,8 +1579,8 @@ func (c *StorageClient) RuntimeEVMNFTs(ctx context.Context, limit *uint64, offse
var contractAddrContextVersion int
var contractAddrData []byte
var tokenType sql.NullInt32
var ownerAddrContextIdentifier string
var ownerAddrContextVersion int
var ownerAddrContextIdentifier *string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a short inline comment here explaining why this is nullable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya

oo come to think of it we should use if nft.Owner != nil instead

@pro-wh pro-wh force-pushed the pro-wh/bugfix/nullowner branch from 48bc254 to 5b876a7 Compare November 22, 2023 19:04
@pro-wh pro-wh merged commit 69df944 into main Nov 22, 2023
6 checks passed
@pro-wh pro-wh deleted the pro-wh/bugfix/nullowner branch November 22, 2023 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-layer API layer-related issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants