Skip to content

Commit

Permalink
Fixes: refactor: Adding a test case for testing parseData() and packD…
Browse files Browse the repository at this point in the history
…ata() #177
  • Loading branch information
blackbeard002 committed Jan 16, 2024
1 parent b7f6603 commit af19624
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/TestSwapFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit af19624

Please sign in to comment.