Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
andresaiello committed Aug 22, 2024
1 parent a5b6ea2 commit ad10f47
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/zevm-app-contracts/data/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"zetaSwapBtcInbound": "0x358E2cfC0E16444Ba7D3164Bbeeb6bEA7472c559",
"invitationManager": "0x3649C03C472B698213926543456E9c21081e529d",
"withdrawERC20": "0xa349B9367cc54b47CAb8D09A95836AE8b4D1d84E",
"ZetaXP": "0xE1DfA5dfd1d6c6b47C8c9b8726EdD019D365491D"
"ZetaXP": "0xfafd6Aaaa836E7744523Ea934D1da28187faE9F8"
},
"zeta_mainnet": {
"disperse": "0x23ce409Ea60c3d75827d04D9db3d52F3af62e44d",
Expand Down
18 changes: 18 additions & 0 deletions packages/zevm-app-contracts/test/xp-nft/xp-nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,22 @@ describe("XP NFT Contract test", () => {
expect(ownerAddr).to.be.eq(user.address);
}
});

it("Should revert if signatured expired", async () => {
const currentBlock = await ethers.provider.getBlock("latest");
const sigTimestamp = currentBlock.timestamp;
const signatureExpiration = sigTimestamp - 1000;

const signature = await getSignature(signer, signatureExpiration, sigTimestamp, sampleNFT.to, sampleNFT);

const nftParams: UpdateParam = {
...sampleNFT,
sigTimestamp,
signature,
signatureExpiration,
} as UpdateParam;

const tx = zetaXP.mintNFT(nftParams);
await expect(tx).to.be.revertedWith("SignatureExpired");
});
});

0 comments on commit ad10f47

Please sign in to comment.