contracts icon indicating copy to clipboard operation
contracts copied to clipboard

fix: ensure subgraphNFT handles metadata with leading zeros correctly

Open tmigone opened this issue 3 years ago • 2 comments
trafficstars

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 [email protected]

tmigone avatar May 24 '22 15:05 tmigone

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.

codecov[bot] avatar May 24 '22 16:05 codecov[bot]

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)

pcarranzav avatar Jan 19 '24 15:01 pcarranzav