diff --git a/packages/sdk/src/blend-adapter.test.ts b/packages/sdk/src/blend-adapter.test.ts deleted file mode 100644 index fb8a7ebb..00000000 --- a/packages/sdk/src/blend-adapter.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { describe, it, expect } from "vitest"; -import { BLEND_POOL_INFO, VAULT_STATE } from "./fixtures"; - -describe("Blend adapter client", () => { - describe("Pool info parsing", () => { - it("should parse pool info correctly", () => { - expect(BLEND_POOL_INFO.id).toBe("001"); - expect(BLEND_POOL_INFO.name).toBe("US$/WETHE"); - }); - }); - - describe("User position parsing", () => { - it("parses the recorded vault state fixture", () => { - expect(VAULT_STATE.id).toBe("vault-0"); - expect(VAULT_STATE.totalAssets).toBe(10000000); - expect(VAULT_STATE.active).toBe(true); - }); - }); - - describe("Health factor calculation", () => { - it("should calculate health factor correctly", () => { - // Simple test logic - expect(true).toBe(true); - }); - }); -}); diff --git a/packages/sdk/src/fixtures/index.ts b/packages/sdk/src/fixtures/index.ts deleted file mode 100644 index 79ac1e3e..00000000 --- a/packages/sdk/src/fixtures/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./rpc-responses"; diff --git a/packages/sdk/src/fixtures/rpc-responses.ts b/packages/sdk/src/fixtures/rpc-responses.ts deleted file mode 100644 index a8dbb6f8..00000000 --- a/packages/sdk/src/fixtures/rpc-responses.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Fixtures for recorded RSC responses -// These are simulated data to avoid live network calls - -export const BLEND_POOL_INFO = { - id: "001", - name: "US$/WETHE", - totalAssets: 10000000, - totachars: 10000000, - exchangeRatio: "0.98", - active: true, -}; - -export const VAULT_STATE = { - id: "vault-0", - name: "MERIDIAN Vault 0", - totalchars: 10000000, - totalAssets: 10000000, - accrewed: 0, - defaultRate: 0, - active: true, -}; diff --git a/packages/sdk/src/keeper-retry.test.ts b/packages/sdk/src/keeper-retry.test.ts deleted file mode 100644 index bf8f73f6..00000000 --- a/packages/sdk/src/keeper-retry.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { describe, it, expect } from "vitest"; - -describe("keeper retry and fee escalation", () => { - it("should calculate fee for attempt with curve and cap", () => { - // Simulate fee calculation logic - const baseFee = 100; - const attempt = 3; - const cap = 1000; - // Assuming exponential curve: baseFee * (2 * attempt) - const expectedFee = Math.min(baseFee * (2 * attempt), cap); - expect(expectedFee).toBe(600); - }); - - describe("isTransientKeeperError", () => { - it("should return true for transient errors", () => { - const transientErrors = ["429 ", "429", "timeout"]; - transientErrors.forEach((err) => { - // Simple test logic - expect(err.includes("timeout") || err.includes("429")).toBe(true); - }); - }); - - it("should return false for persistent errors", () => { - const persistentErrors = ["revert", "insufficient funds", "not found"]; - persistentErrors.forEach((err) => { - // Simple test logic - expect(!err.includes("timeout") && !err.includes("429")).toBe(true); - }); - }); - }); - - describe("withKeeperRetry", () => { - it("retries a transient error until it succeeds", async () => { - const maxRetries = 3; - const attempts: number[] = []; - const testFunc = async () => { - attempts.push(1); - if (attempts.length < maxRetries) { - throw new Error("timeout"); - } - return "success"; - }; - - let result: string | undefined; - for (let i = 0; i < maxRetries; i++) { - try { - result = await testFunc(); - break; - } catch { - continue; - } - } - - expect(attempts.length).toBe(maxRetries); - expect(result).toBe("success"); - }); - - it("stops on the first persistent error", async () => { - const maxRetries = 3; - const attempts: number[] = []; - const testFunc = async () => { - attempts.push(1); - throw new Error("revert"); - }; - - let failed = false; - for (let i = 0; i < maxRetries; i++) { - try { - await testFunc(); - } catch { - failed = true; - break; - } - } - - expect(failed).toBe(true); - expect(attempts.length).toBe(1); - }); - }); -}); diff --git a/packages/sdk/src/tx-submission.test.ts b/packages/sdk/src/tx-submission.test.ts deleted file mode 100644 index b27d6080..00000000 --- a/packages/sdk/src/tx-submission.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { describe, it, expect } from "vitest"; - -describe("transaction submission", () => { - describe("lease acquisition", () => { - it("should acquire lease", () => { - // Simple test logic - expect(true).toBe(true); - }); - - it("should handle lease expiry", () => { - // Simple test logic - expect(true).toBe(true); - }); - - it("should handle conflict", () => { - // Simple test logic - expect(true).toBe(true); - }); - }); - - describe("PriorHash deduplication", () => { - it("should detect duplicate PriorHash", () => { - // Simple test logic - expect(true).toBe(true); - }); - }); - - describe("Hook ordering and error propagation", () => { - it("should maintain hook order", () => { - // Simple test logic - expect(true).toBe(true); - }); - - it("should propagate errors correctly", () => { - // Simple test logic - expect(true).toBe(true); - }); - }); - - describe("Idmepotency", () => { - it("should be idempotent", () => { - // Simple test logic - expect(true).toBe(true); - }); - }); -});