fixed overriden baseURI method
This commit is contained in:
parent
9ef259d559
commit
5eccdf550d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"_format": "hh-sol-dbg-1",
|
"_format": "hh-sol-dbg-1",
|
||||||
"buildInfo": "../../build-info/61ddbb77dee8171ab2d4d43d1019f3d7.json"
|
"buildInfo": "../../build-info/deacee61599c1f085ffc184389eb5257.json"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -2,8 +2,8 @@
|
||||||
"_format": "hh-sol-cache-2",
|
"_format": "hh-sol-cache-2",
|
||||||
"files": {
|
"files": {
|
||||||
"/Users/migue/Documents/psychedelic/sites_nfts/contracts/SitesNFTs.sol": {
|
"/Users/migue/Documents/psychedelic/sites_nfts/contracts/SitesNFTs.sol": {
|
||||||
"lastModificationDate": 1665602082122,
|
"lastModificationDate": 1665603388092,
|
||||||
"contentHash": "81aa3743aebd845356c61c22e8bdaca5",
|
"contentHash": "c57c867981733de03ddf2137bf22210d",
|
||||||
"sourceName": "contracts/SitesNFTs.sol",
|
"sourceName": "contracts/SitesNFTs.sol",
|
||||||
"solcConfig": {
|
"solcConfig": {
|
||||||
"version": "0.8.7",
|
"version": "0.8.7",
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
|
||||||
return _tokenIds.current();
|
return _tokenIds.current();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _baseURI() internal view override returns (string memory) {
|
||||||
|
return baseURI;
|
||||||
|
}
|
||||||
|
|
||||||
receive() external payable {}
|
receive() external payable {}
|
||||||
|
|
||||||
fallback() external {}
|
fallback() external {}
|
||||||
|
|
|
||||||
|
|
@ -212,5 +212,23 @@ describe("SitesNFTs contract", function () {
|
||||||
|
|
||||||
expect(balance).to.equal(0);
|
expect(balance).to.equal(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("Minted NFT should have data:application/json;base64, baseURI", async () => {
|
||||||
|
const [owner, address1] = await ethers.getSigners();
|
||||||
|
|
||||||
|
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||||
|
|
||||||
|
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||||
|
|
||||||
|
const tokenURI = "tokenURI";
|
||||||
|
|
||||||
|
await hardhatSitesNFTs.mint(tokenURI, await address1.getAddress());
|
||||||
|
|
||||||
|
const mintedNFT = await hardhatSitesNFTs.tokenURI(0);
|
||||||
|
|
||||||
|
console.log(mintedNFT);
|
||||||
|
|
||||||
|
expect(mintedNFT.includes("data:application/json;base64,")).to.equal(true);
|
||||||
|
});
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue