From 5741e845529900541245605ca7b7d5747bfb43ae Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 17 Mar 2026 12:50:58 +0000 Subject: [PATCH 1/4] fix: services/txnBot still has dead recenterAccess read infrastructure (#887) Remove recenterAccess.ts, recenterAccess.test.ts, the ABI entry, and getRecenterAccessReader() from BlockchainService. Simplify getRecenterAccessStatus in service.ts to return open access (hasAccess: true) since the on-chain recenterAccess() guard no longer exists. Co-Authored-By: Claude Sonnet 4.6 --- services/txnBot/package.json | 2 +- services/txnBot/src/recenterAccess.test.ts | 45 ------------------- services/txnBot/src/recenterAccess.ts | 40 ----------------- services/txnBot/src/service.ts | 30 ++----------- .../txnBot/src/services/BlockchainService.ts | 11 ----- 5 files changed, 5 insertions(+), 123 deletions(-) delete mode 100644 services/txnBot/src/recenterAccess.test.ts delete mode 100644 services/txnBot/src/recenterAccess.ts diff --git a/services/txnBot/package.json b/services/txnBot/package.json index b2c1856..9a89e9d 100644 --- a/services/txnBot/package.json +++ b/services/txnBot/package.json @@ -8,7 +8,7 @@ "build": "tsc -p tsconfig.build.json", "start": "node dist/service.js", "dev": "tsx watch src/service.ts", - "test": "node --test --import tsx src/recenterAccess.test.ts", + "test": "node --test --import tsx", "lint": "eslint src/**/*.ts", "lint:fix": "eslint --fix src/**/*.ts", "format": "prettier --write src/**/*.ts", diff --git a/services/txnBot/src/recenterAccess.test.ts b/services/txnBot/src/recenterAccess.test.ts deleted file mode 100644 index 69867d3..0000000 --- a/services/txnBot/src/recenterAccess.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import assert from 'node:assert/strict'; -import test from 'node:test'; -import { ethers } from 'ethers'; -import { hasRecenterAccess, readRecenterAccess, type RecenterAccessReader } from './recenterAccess.js'; - -const ZERO_ADDRESS = ethers.ZeroAddress; - -class MockRecenterAccessReader implements RecenterAccessReader { - constructor( - private readonly value: string, - private readonly shouldThrow = false - ) {} - - async recenterAccess(): Promise { - if (this.shouldThrow) { - throw new Error('read failed'); - } - return this.value; - } -} - -test('readRecenterAccess returns zero address for empty or zero values', async () => { - const reader = new MockRecenterAccessReader('0x0000000000000000000000000000000000000000'); - assert.equal(await readRecenterAccess(reader, ZERO_ADDRESS), ZERO_ADDRESS); - - const emptyReader = new MockRecenterAccessReader(''); - assert.equal(await readRecenterAccess(emptyReader, ZERO_ADDRESS), ZERO_ADDRESS); -}); - -test('readRecenterAccess normalises checksum addresses', async () => { - const reader = new MockRecenterAccessReader('0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'); - assert.equal(await readRecenterAccess(reader, ZERO_ADDRESS), '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'); -}); - -test('readRecenterAccess throws when reader fails', async () => { - const reader = new MockRecenterAccessReader('0x0', true); - await assert.rejects(() => readRecenterAccess(reader, ZERO_ADDRESS), /read failed/); -}); - -test('hasRecenterAccess acknowledges zero or wallet matches', () => { - const wallet = '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'; - assert.equal(hasRecenterAccess(ZERO_ADDRESS, wallet, ZERO_ADDRESS), true); - assert.equal(hasRecenterAccess(wallet, wallet, ZERO_ADDRESS), true); - assert.equal(hasRecenterAccess('0x5cFB5CDd3E8723ba98312c90a43a4d6Ac6121240', wallet, ZERO_ADDRESS), false); -}); diff --git a/services/txnBot/src/recenterAccess.ts b/services/txnBot/src/recenterAccess.ts deleted file mode 100644 index d45dba9..0000000 --- a/services/txnBot/src/recenterAccess.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ethers } from 'ethers'; - -export interface RecenterAccessReader { - recenterAccess(): Promise; -} - -export async function readRecenterAccess(reader: RecenterAccessReader, zeroAddress: string): Promise { - let raw: string; - try { - raw = await reader.recenterAccess(); - } catch (error) { - throw new Error(`Failed to read recenterAccess: ${(error as Error).message}`); - } - - if (typeof raw !== 'string' || raw.length === 0) { - return zeroAddress; - } - - if (raw === zeroAddress) { - return zeroAddress; - } - - try { - return ethers.getAddress(raw); - } catch (error) { - throw new Error(`Invalid recenterAccess address: ${(error as Error).message}`); - } -} - -export function hasRecenterAccess(recenterAddress: string, walletAddress: string, zeroAddress: string): boolean { - if (recenterAddress === zeroAddress) { - return true; - } - - try { - return ethers.getAddress(recenterAddress) === ethers.getAddress(walletAddress); - } catch { - return false; - } -} diff --git a/services/txnBot/src/service.ts b/services/txnBot/src/service.ts index a644c0a..b5c401d 100644 --- a/services/txnBot/src/service.ts +++ b/services/txnBot/src/service.ts @@ -1,5 +1,4 @@ import express, { NextFunction, Request, Response } from 'express'; -import { ethers } from 'ethers'; import { decodePositionId } from 'kraiken-lib/ids'; import { isPositionDelinquent } from 'kraiken-lib/staking'; import { pathToFileURL } from 'url'; @@ -7,7 +6,6 @@ import { BotConfigService } from './services/BotConfigService.js'; import { BlockchainService } from './services/BlockchainService.js'; import { GraphQLService } from './services/GraphQLService.js'; import { logger } from './logger.js'; -import { hasRecenterAccess, readRecenterAccess } from './recenterAccess.js'; import { Position, RecenterAccessStatus, RecenterEligibility, RecenterResult } from './types.js'; const ACTIVE_POSITIONS_QUERY = ` @@ -24,8 +22,6 @@ const ACTIVE_POSITIONS_QUERY = ` } `; -const ZERO_ADDRESS = ethers.ZeroAddress; - export interface TxnBotDependencies { configService: BotConfigService; blockchainService: BlockchainService; @@ -91,8 +87,6 @@ function formatDuration(ms: number): string { export function createTxnBot(dependencies: TxnBotDependencies): TxnBotInstance { const { configService, blockchainService, graphQLService } = dependencies; const envConfig = configService.getConfig(); - const recenterAccessReader = blockchainService.getRecenterAccessReader(); - const walletAddress = blockchainService.getWalletAddress(); const startTime = new Date(); let lastRecenterTime: Date | null = null; @@ -125,28 +119,12 @@ export function createTxnBot(dependencies: TxnBotDependencies): TxnBotInstance { return lastRecenterAccessStatus; } - let recenterAddress: string | null = null; - let hasAccess: boolean | null = null; - let slotHex: string | null = null; - let errorMessage: string | null = null; - - try { - const address = await readRecenterAccess(recenterAccessReader, ZERO_ADDRESS); - recenterAddress = address; - hasAccess = hasRecenterAccess(address, walletAddress, ZERO_ADDRESS); - slotHex = 'recenterAccess()'; - } catch (error) { - const err = error as { shortMessage?: string; message?: string }; - errorMessage = err?.shortMessage || err?.message || 'unknown error'; - recenterAddress = null; - } - lastRecenterAccessStatus = { - hasAccess, - recenterAccessAddress: recenterAddress, - slot: slotHex, + hasAccess: true, + recenterAccessAddress: null, + slot: null, checkedAtMs: now, - error: errorMessage, + error: null, }; return lastRecenterAccessStatus; diff --git a/services/txnBot/src/services/BlockchainService.ts b/services/txnBot/src/services/BlockchainService.ts index ba13239..27ff84f 100644 --- a/services/txnBot/src/services/BlockchainService.ts +++ b/services/txnBot/src/services/BlockchainService.ts @@ -1,5 +1,4 @@ import { Contract, JsonRpcProvider, TransactionResponse, Wallet, ethers } from 'ethers'; -import { RecenterAccessReader } from '../recenterAccess.js'; export interface BlockchainConfig { providerUrl: string; @@ -11,7 +10,6 @@ export interface BlockchainConfig { const LM_ABI = [ { type: 'function', name: 'recenter', inputs: [], outputs: [], stateMutability: 'nonpayable' }, { type: 'function', name: 'feeDestination', inputs: [], outputs: [{ type: 'address' }], stateMutability: 'view' }, - { type: 'function', name: 'recenterAccess', inputs: [], outputs: [{ type: 'address' }], stateMutability: 'view' }, ]; const STAKE_ABI = [ @@ -41,15 +39,6 @@ export class BlockchainService { return ethers.getAddress(this.wallet.address); } - getRecenterAccessReader(): RecenterAccessReader { - return { - recenterAccess: async (): Promise => { - const method = this.liquidityManager.getFunction('recenterAccess'); - return (await method()) as string; - }, - }; - } - async checkFunds(): Promise { const balance = await this.provider.getBalance(this.wallet.address); return ethers.formatEther(balance); From f2ba1181f4eff6038c688b6de3ad0428152d036b Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 17 Mar 2026 12:51:07 +0000 Subject: [PATCH 2/4] fix: services/txnBot still has dead recenterAccess read infrastructure (#887) --- kraiken-lib/package-lock.json | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/kraiken-lib/package-lock.json b/kraiken-lib/package-lock.json index 58c0c9e..2c47f7c 100644 --- a/kraiken-lib/package-lock.json +++ b/kraiken-lib/package-lock.json @@ -226,6 +226,7 @@ "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.2", @@ -2742,6 +2743,7 @@ "integrity": "sha512-F1CBxgqwOMc4GKJ7eY22hWhBVQuMYTtqI8L0FcszYcpYX0fzfDGpez22Xau8Mgm7O9fI+zA/TYIdq3tGWfweBA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.13.0" } @@ -2802,6 +2804,7 @@ "integrity": "sha512-TGf22kon8KW+DeKaUmOibKWktRY8b2NSAZNdtWh798COm1NWx8+xJ6iFBtk3IvLdv6+LGLJLRlyhrhEDZWargQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.45.0", "@typescript-eslint/types": "8.45.0", @@ -3413,6 +3416,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3737,6 +3741,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001587", "electron-to-chromium": "^1.4.668", @@ -4525,6 +4530,7 @@ "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -5222,6 +5228,7 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -5304,8 +5311,9 @@ "version": "5.16.0", "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.16.0.tgz", "integrity": "sha512-Ju2RCU2dQMgSKtArPbEtsK5gNLnsQyTNIo/T7cZNp96niC1x0KdJNZV0TIoilceBPQwfb5itrGl8pkFeOUMl4A==", - "dev": true, + "devOptional": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -7212,6 +7220,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -8146,8 +8155,9 @@ "version": "5.4.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8354,6 +8364,7 @@ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -8452,6 +8463,7 @@ "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/chai": "^5.2.2", "@vitest/expect": "3.2.4", @@ -8667,6 +8679,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, From ad680b8ced06aaab95e5b331c63316accf50c758 Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 17 Mar 2026 13:22:10 +0000 Subject: [PATCH 3/4] fix: address review findings from recenterAccess cleanup (#887) - Remove permanently unreachable guard branches from evaluateRecenterOpportunity - Remove orphaned getWalletAddress() from BlockchainService - Simplify RecenterAccessStatus type: drop always-null recenterAccessAddress and slot fields, narrow hasAccess to boolean - Update /status endpoint to match simplified type - Remove test script (no test files remain) - Revert unrelated kraiken-lib/package-lock.json churn Co-Authored-By: Claude Sonnet 4.6 --- kraiken-lib/package-lock.json | 17 ++--------- services/txnBot/package.json | 1 - services/txnBot/src/service.ts | 28 +------------------ .../txnBot/src/services/BlockchainService.ts | 4 --- services/txnBot/src/types.ts | 4 +-- 5 files changed, 4 insertions(+), 50 deletions(-) diff --git a/kraiken-lib/package-lock.json b/kraiken-lib/package-lock.json index 2c47f7c..58c0c9e 100644 --- a/kraiken-lib/package-lock.json +++ b/kraiken-lib/package-lock.json @@ -226,7 +226,6 @@ "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.2", @@ -2743,7 +2742,6 @@ "integrity": "sha512-F1CBxgqwOMc4GKJ7eY22hWhBVQuMYTtqI8L0FcszYcpYX0fzfDGpez22Xau8Mgm7O9fI+zA/TYIdq3tGWfweBA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.13.0" } @@ -2804,7 +2802,6 @@ "integrity": "sha512-TGf22kon8KW+DeKaUmOibKWktRY8b2NSAZNdtWh798COm1NWx8+xJ6iFBtk3IvLdv6+LGLJLRlyhrhEDZWargQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.45.0", "@typescript-eslint/types": "8.45.0", @@ -3416,7 +3413,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3741,7 +3737,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001587", "electron-to-chromium": "^1.4.668", @@ -4530,7 +4525,6 @@ "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -5228,7 +5222,6 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "license": "MIT", - "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -5311,9 +5304,8 @@ "version": "5.16.0", "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.16.0.tgz", "integrity": "sha512-Ju2RCU2dQMgSKtArPbEtsK5gNLnsQyTNIo/T7cZNp96niC1x0KdJNZV0TIoilceBPQwfb5itrGl8pkFeOUMl4A==", - "devOptional": true, + "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -7220,7 +7212,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -8155,9 +8146,8 @@ "version": "5.4.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", - "devOptional": true, + "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8364,7 +8354,6 @@ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -8463,7 +8452,6 @@ "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/chai": "^5.2.2", "@vitest/expect": "3.2.4", @@ -8679,7 +8667,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, diff --git a/services/txnBot/package.json b/services/txnBot/package.json index 9a89e9d..d2b4410 100644 --- a/services/txnBot/package.json +++ b/services/txnBot/package.json @@ -8,7 +8,6 @@ "build": "tsc -p tsconfig.build.json", "start": "node dist/service.js", "dev": "tsx watch src/service.ts", - "test": "node --test --import tsx", "lint": "eslint src/**/*.ts", "lint:fix": "eslint --fix src/**/*.ts", "format": "prettier --write src/**/*.ts", diff --git a/services/txnBot/src/service.ts b/services/txnBot/src/service.ts index b5c401d..f14eaa1 100644 --- a/services/txnBot/src/service.ts +++ b/services/txnBot/src/service.ts @@ -121,8 +121,6 @@ export function createTxnBot(dependencies: TxnBotDependencies): TxnBotInstance { lastRecenterAccessStatus = { hasAccess: true, - recenterAccessAddress: null, - slot: null, checkedAtMs: now, error: null, }; @@ -132,28 +130,6 @@ export function createTxnBot(dependencies: TxnBotDependencies): TxnBotInstance { async function evaluateRecenterOpportunity(): Promise { const now = Date.now(); - const accessStatus = await getRecenterAccessStatus(true); - - if (accessStatus.error && accessStatus.hasAccess === null) { - lastRecenterEligibility = { - checkedAtMs: now, - canRecenter: false, - reason: 'Failed to determine recenter access.', - error: accessStatus.error, - }; - return lastRecenterEligibility; - } - - if (accessStatus.hasAccess === false) { - lastRecenterEligibility = { - checkedAtMs: now, - canRecenter: false, - reason: 'txnBot is not the authorized recenter caller.', - error: null, - }; - return lastRecenterEligibility; - } - try { await blockchainService.estimateRecenterGas(); lastRecenterEligibility = { @@ -265,9 +241,7 @@ export function createTxnBot(dependencies: TxnBotDependencies): TxnBotInstance { lastLiquidationTime: lastLiquidationTime ? lastLiquidationTime.toISOString() : 'Never', lastRecenterTx, recenterAccess: { - hasAccess: recenterAccessStatus?.hasAccess ?? null, - grantedTo: recenterAccessStatus?.recenterAccessAddress ?? null, - slot: recenterAccessStatus?.slot ?? null, + hasAccess: recenterAccessStatus?.hasAccess ?? true, checkedAt: recenterAccessStatus?.checkedAtMs ? new Date(recenterAccessStatus.checkedAtMs).toISOString() : null, error: recenterAccessStatus?.error ?? null, }, diff --git a/services/txnBot/src/services/BlockchainService.ts b/services/txnBot/src/services/BlockchainService.ts index 27ff84f..6370818 100644 --- a/services/txnBot/src/services/BlockchainService.ts +++ b/services/txnBot/src/services/BlockchainService.ts @@ -35,10 +35,6 @@ export class BlockchainService { this.stakeContract = new ethers.Contract(config.stakeContractAddress, STAKE_ABI, this.wallet); } - getWalletAddress(): string { - return ethers.getAddress(this.wallet.address); - } - async checkFunds(): Promise { const balance = await this.provider.getBalance(this.wallet.address); return ethers.formatEther(balance); diff --git a/services/txnBot/src/types.ts b/services/txnBot/src/types.ts index 4943245..aae6f7e 100644 --- a/services/txnBot/src/types.ts +++ b/services/txnBot/src/types.ts @@ -17,9 +17,7 @@ export interface EnvConfig { } export interface RecenterAccessStatus { - hasAccess: boolean | null; - recenterAccessAddress: string | null; - slot: string | null; + hasAccess: boolean; checkedAtMs: number; error: string | null; } From 8c31a68fa8d728b53d104d182a87a26a71e6a66a Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 17 Mar 2026 13:34:03 +0000 Subject: [PATCH 4/4] fix: restore test script in txnBot package.json (#887) CI calls npm run test; removing the script entirely caused a hard failure. Restore it as node --test --import tsx (auto-discovery, no explicit file), which exits 0 with zero tests now that recenterAccess.test.ts is deleted. Co-Authored-By: Claude Sonnet 4.6 --- services/txnBot/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/services/txnBot/package.json b/services/txnBot/package.json index d2b4410..9a89e9d 100644 --- a/services/txnBot/package.json +++ b/services/txnBot/package.json @@ -8,6 +8,7 @@ "build": "tsc -p tsconfig.build.json", "start": "node dist/service.js", "dev": "tsx watch src/service.ts", + "test": "node --test --import tsx", "lint": "eslint src/**/*.ts", "lint:fix": "eslint --fix src/**/*.ts", "format": "prettier --write src/**/*.ts",