From 40c29a97be1d1c4d8a9ef2869670a81d6c3fb84a Mon Sep 17 00:00:00 2001 From: guoyunfeng Date: Sun, 25 Oct 2026 04:22:00 +0800 Subject: [PATCH] refactor(fee): remove unused formatFee and its tests (closes #1039) --- __tests__/lib/fee-utils.test.ts | 15 --------------- lib/fee-utils.ts | 8 -------- 2 files changed, 23 deletions(-) diff --git a/__tests__/lib/fee-utils.test.ts b/__tests__/lib/fee-utils.test.ts index 20596ee..d6c3503 100644 --- a/__tests__/lib/fee-utils.test.ts +++ b/__tests__/lib/fee-utils.test.ts @@ -2,7 +2,6 @@ import { describe, it, expect } from "vitest"; import { calculateFeeBreakdown, isHighFee, - formatFee, calculateBatchFees, TYPICAL_FEES, } from "@/lib/fee-utils"; @@ -51,20 +50,6 @@ describe("isHighFee", () => { }); }); -describe("formatFee", () => { - it("converts stroops to XLM string", () => { - expect(formatFee(10_000_000)).toBe("1.0000000"); - }); - - it("respects decimals parameter", () => { - expect(formatFee(10_000_000, 2)).toBe("1.00"); - }); - - it("handles small fees", () => { - expect(formatFee(100)).toBe("0.0000100"); - }); -}); - describe("calculateBatchFees", () => { it("multiplies fee per operation by count", () => { const result = calculateBatchFees(5, 50_000); diff --git a/lib/fee-utils.ts b/lib/fee-utils.ts index f778815..fd4e1af 100644 --- a/lib/fee-utils.ts +++ b/lib/fee-utils.ts @@ -52,14 +52,6 @@ export function isHighFee(fee: number, averageFee: number): boolean { return fee > averageFee * 2; } -/** - * Format fee amount for display - */ -export function formatFee(stroops: number, decimals: number = 7): string { - const xlm = stroops / 1e7; - return xlm.toFixed(Math.min(decimals, 7)); -} - /** * Calculate batch operation total fees */