Skip to content

Commit

Permalink
Set baseExtension to .json in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
matejos committed Apr 11, 2024
1 parent 6c0af96 commit c906629
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ contract InverseAppProjected1155 is IInverseAppProjected1155, ERC1155Supply, Own
name = _name;
symbol = _symbol;
currentTokenId = 1;
baseExtension = ".json";
}

/// @dev Returns true if this contract implements the interface defined by `interfaceId`. See EIP165.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ contract InverseBaseProjected1155 is IInverseBaseProjected1155, ERC1155Supply, O
name = _name;
symbol = _symbol;
currentTokenId = 1;
baseExtension = ".json";
}

/// @dev Returns true if this contract implements the interface defined by `interfaceId`. See EIP165.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ contract InverseAppProjected1155Test is CTest, ERC1155Holder {
"/",
userTokenId.toString(),
"/",
value.toString()
value.toString(),
".json"
)
);
}
Expand All @@ -158,7 +159,8 @@ contract InverseAppProjected1155Test is CTest, ERC1155Holder {
"/",
userTokenId.toString(),
"/",
value.toString()
value.toString(),
".json"
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,14 @@ contract InverseBaseProjected1155Test is CTest, ERC1155Holder {
string memory result = token.uri(tokenId);
assertEq(
result,
string.concat(baseURI, "eip155:", block.chainid.toString(), "/", tokenId.toString())
string.concat(
baseURI,
"eip155:",
block.chainid.toString(),
"/",
tokenId.toString(),
".json"
)
);
}

Expand All @@ -111,7 +118,14 @@ contract InverseBaseProjected1155Test is CTest, ERC1155Holder {
string memory result = token.uri(tokenId, customUri);
assertEq(
result,
string.concat(customUri, "eip155:", block.chainid.toString(), "/", tokenId.toString())
string.concat(
customUri,
"eip155:",
block.chainid.toString(),
"/",
tokenId.toString(),
".json"
)
);
}

Expand Down

0 comments on commit c906629

Please sign in to comment.