From fc478dc12f9df77058443cd259c7754be03aa367 Mon Sep 17 00:00:00 2001 From: PedroCailleret Date: Sat, 3 Dec 2022 04:38:30 -0300 Subject: [PATCH] updated test coverage todos --- test/Reputation.test.ts | 0 test/_.test.ts | 7 ++++ test/{ => old}/1-deposit.test.ts | 0 test/{ => old}/2-lock-release.test.ts | 0 test/p2pix.test.ts | 48 +++++++++++++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 test/Reputation.test.ts create mode 100644 test/_.test.ts rename test/{ => old}/1-deposit.test.ts (100%) rename test/{ => old}/2-lock-release.test.ts (100%) diff --git a/test/Reputation.test.ts b/test/Reputation.test.ts new file mode 100644 index 0000000..e69de29 diff --git a/test/_.test.ts b/test/_.test.ts new file mode 100644 index 0000000..df06161 --- /dev/null +++ b/test/_.test.ts @@ -0,0 +1,7 @@ +/* eslint-disable no-useless-escape */ + +describe("_", () => { + console.log( + "/// ______ __\r\n/// .-----.|__ |.-----.|__|.--.--.\r\n/// | _ || __|| _ || ||_ _|\r\n/// | __||______|| __||__||__.__|\r\n/// |__| |__|\r\n///", + ); +}); diff --git a/test/1-deposit.test.ts b/test/old/1-deposit.test.ts similarity index 100% rename from test/1-deposit.test.ts rename to test/old/1-deposit.test.ts diff --git a/test/2-lock-release.test.ts b/test/old/2-lock-release.test.ts similarity index 100% rename from test/2-lock-release.test.ts rename to test/old/2-lock-release.test.ts diff --git a/test/p2pix.test.ts b/test/p2pix.test.ts index 82ecbf6..074d4cf 100644 --- a/test/p2pix.test.ts +++ b/test/p2pix.test.ts @@ -234,4 +234,52 @@ describe("P2PIX", () => { ); }); }); + describe("Deposit", async () => { + // it ("should revert if ERC20 is not alloed") + // it ("should revert if deposit already exists") + // it ("should create deposit, update storage and emit event") + // it ("should create multiple deposits") - EDGE CASE TEST + }); + describe("Lock", async () => { + // it ("should revert if deposit is invalid") + // it ("should revert if wished amount is greater than deposit's remaining amount") + // it ("should revert if a non expired lock has the same ID encoded") + // it ("should revert if an invalid allowlist merkleproof is provided") + // it ("should revert if msg.sender does not have enough credit in his spend limit") + // it ("should create a lock, update storage and emit events via the allowlist path") + // it ("should create a lock, update storage and emit events via the reputation path") + // it ("should create multiple locks") - EDGE CASE TEST + // CHECK UNEXPIRE LOCK + }); + describe("Cancel Deposit", async () => { + // it("should revert if the msg.sender isn't the deposit's seller") + // it("should cancel deposit, update storage and emit events") + // it("should cancel multiple deposits") + }); + describe("Release", async () => { + // it("should revert if lock has expired or has already been released") + // it("should revert if signed message has already been used") + // it("should revert if ecrecovered signer is invalid") + // it("should release lock, update storage and emit events") + // it("should release multiple locks") - EDGE CASE TEST { + // TEST 3 CASES ( + // EMPTY PREMIUM, + // LOCK RELAYER != RELEASE RELAYER, (check userRecord storage update) + // LOCK RELAYER == RELEASE RELAYER (check userRecord storage update) + // )} + }); + describe("Unlock Expired Locks", async () => { + // it("should revert if lock isn't expired") + // it("should unlock expired locks, update storage and emit events") + // CHECK FOR userRecord STORAGE UPDATE + }); + describe("Seller withdraw", async () => { + // it("should revert if the msg.sender isn't the deposit's seller") + // it -> withdraw remaining funds from deposit + // CHECK UNEXPIRE LOCKS + }); + describe("Seller Allowlist Settings", async () => { + // it -> set root of seller's allowlist + // (test msg.sender != seller error) + }); });