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

fix: ensure subgraphNFT handles metadata with leading zeros correctly #577

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmigone
Copy link
Contributor

@tmigone tmigone commented May 24, 2022

Motivation

The tokenURI being reported by SubgraphNFT contract using the tokenURI function is incorrect when the subgraph metadata hash contains leading zeroes. #576 describes the problem in detail.

Changes

  • Added test to check for this special case where subgraph metadata hash is of the form 0x00....
  • Fix in SubgraphNFT contract

Closes: #576
Signed-off-by: Tomás Migone tomas@edgeandnode.com

Closes: #576
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@codecov
Copy link

codecov bot commented May 24, 2022

Codecov Report

Merging #577 (ff7880e) into dev (6e9b7f1) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##              dev     #577   +/-   ##
=======================================
  Coverage   90.49%   90.49%           
=======================================
  Files          35       35           
  Lines        1747     1747           
  Branches      290      290           
=======================================
  Hits         1581     1581           
  Misses        166      166           
Flag Coverage Δ
unittests 90.49% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
contracts/discovery/SubgraphNFT.sol 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e9b7f1...ff7880e. Read the comment docs.

@tmigone tmigone added the bug Something isn't working label May 24, 2022
@pcarranzav
Copy link
Member

Since we won't be able to deploy this fix, should we close this and leave the issue open as a known bug? (We can reopen if we ever get a chance to deploy a new SubgraphNFT for whatever reason)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working protocol change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GNS tests fail if subgraphNFT's tokenURI has leading zeros
3 participants