diff --git a/test/TestSwapFactory.test.ts b/test/TestSwapFactory.test.ts index deddf21..fc3d692 100644 --- a/test/TestSwapFactory.test.ts +++ b/test/TestSwapFactory.test.ts @@ -257,4 +257,15 @@ describe("Swaplace Factory", async function () { expect(error.message).to.be.equals("InvalidAssetsLength"); } }); + + it("Should ensure packData() and parseData() return the right values",async function () { + const currentTimestamp = (await blocktimestamp()) * 2; + + const config = await Swaplace.packData(acceptee, currentTimestamp); + + const [allowed, expiry] = await Swaplace.parseData(config); + + expect(allowed).to.be.equals(acceptee); + expect(expiry).to.be.equals(currentTimestamp); + }); });