From d126e4bdc448c9c9cf533dc5e653505af2ff0617 Mon Sep 17 00:00:00 2001 From: johnsonchin Date: Mon, 19 Jan 2026 13:39:17 +0800 Subject: [PATCH 1/4] fix: added buyer secrets --- .github/workflows/ci-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 068ea1d..346577d 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -34,6 +34,8 @@ jobs: WHITELISTED_WALLET_PRIVATE_KEY: ${{ secrets.WHITELISTED_WALLET_PRIVATE_KEY }} SELLER_ENTITY_ID: ${{ secrets.SELLER_ENTITY_ID }} SELLER_AGENT_WALLET_ADDRESS: ${{ secrets.SELLER_AGENT_WALLET_ADDRESS }} + BUYER_ENTITY_ID: ${{ secrets.BUYER_ENTITY_ID }} + BUYER_AGENT_WALLET_ADDRESS: ${{ secrets.BUYER_AGENT_WALLET_ADDRESS }} - name: uploads results uses: actions/upload-artifact@v4 From 8b83dc5d3456ca45861efc9041647efadb6e76bd Mon Sep 17 00:00:00 2001 From: johnsonchin Date: Mon, 19 Jan 2026 14:19:50 +0800 Subject: [PATCH 2/4] hotfix: added debugger --- test/env.debug.test.ts | 25 +++++++++++++++++++++++++ test/env.ts | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/env.debug.test.ts diff --git a/test/env.debug.test.ts b/test/env.debug.test.ts new file mode 100644 index 0000000..e0d958b --- /dev/null +++ b/test/env.debug.test.ts @@ -0,0 +1,25 @@ +import { + WHITELISTED_WALLET_PRIVATE_KEY, + BUYER_ENTITY_ID, + BUYER_AGENT_WALLET_ADDRESS, + SELLER_ENTITY_ID, + SELLER_AGENT_WALLET_ADDRESS, +} from "./env"; + +describe("Environment Variables Debug", () => { + it("should load all required environment variables", () => { + console.log("=== ENV VARS DEBUG ==="); + console.log("WHITELISTED_WALLET_PRIVATE_KEY:", WHITELISTED_WALLET_PRIVATE_KEY ? "✓ SET" : "✗ MISSING"); + console.log("BUYER_ENTITY_ID:", BUYER_ENTITY_ID); + console.log("BUYER_AGENT_WALLET_ADDRESS:", BUYER_AGENT_WALLET_ADDRESS ? "✓ SET" : "✗ MISSING"); + console.log("SELLER_ENTITY_ID:", SELLER_ENTITY_ID); + console.log("SELLER_AGENT_WALLET_ADDRESS:", SELLER_AGENT_WALLET_ADDRESS ? "✓ SET" : "✗ MISSING"); + console.log("======================"); + + expect(WHITELISTED_WALLET_PRIVATE_KEY).toBeDefined(); + expect(BUYER_ENTITY_ID).toBeDefined(); + expect(BUYER_AGENT_WALLET_ADDRESS).toBeDefined(); + expect(SELLER_ENTITY_ID).toBeDefined(); + expect(SELLER_AGENT_WALLET_ADDRESS).toBeDefined(); + }); +}); diff --git a/test/env.ts b/test/env.ts index d46233c..5c1c40a 100644 --- a/test/env.ts +++ b/test/env.ts @@ -1,7 +1,8 @@ import dotenv from "dotenv"; import { Address } from "viem"; +import * as path from "path"; -dotenv.config({ path: __dirname + "/.env" }); +dotenv.config({ path: path.join(__dirname, ".env") }); function getEnvVar(key: string, required = true): T { const value = process.env[key]; From 111dfa4ce7ba89f80fde15309897f1a40a95c768 Mon Sep 17 00:00:00 2001 From: johnsonchin Date: Tue, 20 Jan 2026 11:29:21 +0800 Subject: [PATCH 3/4] fix: modified testing environemtns - will only run unit and component tests on pull request - will run all tests on push to main --- .github/workflows/ci-test.yml | 7 ++++++- package.json | 1 + test/env.debug.test.ts | 25 ------------------------- 3 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 test/env.debug.test.ts diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 346577d..dc0582c 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -28,7 +28,12 @@ jobs: - name: installing dependencies run: npm ci - - name: run tests + - name: run unit tests (on pr) + if: github.event_name == 'pull_request' + run: npm run test:unit -- --reporters=default --reporters=jest-junit + + - name: run all tests + if: github.event_name == "push" run: npm run test:ci env: WHITELISTED_WALLET_PRIVATE_KEY: ${{ secrets.WHITELISTED_WALLET_PRIVATE_KEY }} diff --git a/package.json b/package.json index 24349f9..25d849f 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "types": "./dist/index.d.ts", "scripts": { "test": "jest", + "test:unit": "jest test/unit test/component", "test:ci": "jest --ci --reporters=default --reporters=jest-junit", "test:watch": "jest --watch", "test:coverage": "jest --coverage", diff --git a/test/env.debug.test.ts b/test/env.debug.test.ts deleted file mode 100644 index e0d958b..0000000 --- a/test/env.debug.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - WHITELISTED_WALLET_PRIVATE_KEY, - BUYER_ENTITY_ID, - BUYER_AGENT_WALLET_ADDRESS, - SELLER_ENTITY_ID, - SELLER_AGENT_WALLET_ADDRESS, -} from "./env"; - -describe("Environment Variables Debug", () => { - it("should load all required environment variables", () => { - console.log("=== ENV VARS DEBUG ==="); - console.log("WHITELISTED_WALLET_PRIVATE_KEY:", WHITELISTED_WALLET_PRIVATE_KEY ? "✓ SET" : "✗ MISSING"); - console.log("BUYER_ENTITY_ID:", BUYER_ENTITY_ID); - console.log("BUYER_AGENT_WALLET_ADDRESS:", BUYER_AGENT_WALLET_ADDRESS ? "✓ SET" : "✗ MISSING"); - console.log("SELLER_ENTITY_ID:", SELLER_ENTITY_ID); - console.log("SELLER_AGENT_WALLET_ADDRESS:", SELLER_AGENT_WALLET_ADDRESS ? "✓ SET" : "✗ MISSING"); - console.log("======================"); - - expect(WHITELISTED_WALLET_PRIVATE_KEY).toBeDefined(); - expect(BUYER_ENTITY_ID).toBeDefined(); - expect(BUYER_AGENT_WALLET_ADDRESS).toBeDefined(); - expect(SELLER_ENTITY_ID).toBeDefined(); - expect(SELLER_AGENT_WALLET_ADDRESS).toBeDefined(); - }); -}); From 8689276033c6bea4809955158366796739c582a8 Mon Sep 17 00:00:00 2001 From: johnsonchin Date: Tue, 20 Jan 2026 11:35:18 +0800 Subject: [PATCH 4/4] fix: changed to single quotes --- .github/workflows/ci-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index dc0582c..ba4560c 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -33,7 +33,7 @@ jobs: run: npm run test:unit -- --reporters=default --reporters=jest-junit - name: run all tests - if: github.event_name == "push" + if: github.event_name == 'push' run: npm run test:ci env: WHITELISTED_WALLET_PRIVATE_KEY: ${{ secrets.WHITELISTED_WALLET_PRIVATE_KEY }}