From c3db71dabba0a315112aa3e13371aaf51dc83901 Mon Sep 17 00:00:00 2001 From: Eromosele0110 Date: Fri, 26 Jun 2026 12:56:15 +0000 Subject: [PATCH] fix: clarify fee handling in SorobanInvokeTool and StellarPaymentTool - SorobanInvokeTool: replace BASE_FEE with "0" and add comment explaining the initial fee is irrelevant since prepareSorobanTx overwrites it - StellarPaymentTool: add comment clarifying BASE_FEE is the actual fee for classic Stellar payments and is not overwritten - Remove unused BASE_FEE import from SorobanInvokeTool - .gitignore: remove !tests/__snapshots__/ forced-tracking line Closes #91 --- .gitignore | 2 -- backend/tools/SorobanInvokeTool.ts | 3 +-- backend/tools/StellarPaymentTool.ts | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c84fd3c..582000b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,3 @@ contracts/escrow/test_snapshots/ .env.test.local .env.production.local -# Track TypeScript/Vitest snapshot files explicitly -!tests/__snapshots__/ diff --git a/backend/tools/SorobanInvokeTool.ts b/backend/tools/SorobanInvokeTool.ts index b03d7c3..69a72a5 100644 --- a/backend/tools/SorobanInvokeTool.ts +++ b/backend/tools/SorobanInvokeTool.ts @@ -10,7 +10,6 @@ import { TransactionBuilder, Operation, Contract, - BASE_FEE, nativeToScVal, xdr, } from "@stellar/stellar-sdk"; @@ -151,7 +150,7 @@ export class SorobanInvokeTool { // 3. Build invocation transaction const tx = new TransactionBuilder(sourceAccount, { - fee: BASE_FEE, + fee: "0", // Fee is overwritten by prepareSorobanTx — initial value is irrelevant networkPassphrase: this.networkPassphrase, }) .addOperation(contract.call(input.method, ...input.args)) diff --git a/backend/tools/StellarPaymentTool.ts b/backend/tools/StellarPaymentTool.ts index 040b716..383e63d 100644 --- a/backend/tools/StellarPaymentTool.ts +++ b/backend/tools/StellarPaymentTool.ts @@ -117,7 +117,7 @@ export class StellarPaymentTool { // 4. Build transaction const buildTx = () => { const builder = new TransactionBuilder(sourceAccount, { - fee: BASE_FEE, + fee: BASE_FEE, // BASE_FEE (100 stroops) is the actual fee for classic Stellar payments — not overwritten networkPassphrase: this.networkPassphrase, }) .addOperation(