Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Adding a test case for testing parseData() and packData() #177 #178

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/TestSwapFactory.test.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The acceptee should be acceptee.address

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xneves yeah I just realized it and fixed. Anyways ready for review

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.address, currentTimestamp);

const [allowed, expiry] = await Swaplace.parseData(config);

expect(allowed).to.be.equals(acceptee.address);
expect(expiry).to.be.equals(currentTimestamp);
});
});
Loading