Fix tx-history tests: align with expanded enums and new blockchain verification logic#457
Draft
Fix tx-history tests: align with expanded enums and new blockchain verification logic#457
Conversation
…t tests Co-authored-by: alexjavabraz <14118998+alexjavabraz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix tests in tx-history.controller.ts
Fix tx-history tests: align with expanded enums and new blockchain verification logic
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tx-history unit tests were broken by model enum expansions and a new blockchain verification flow added to the
storeTransactionendpoint. Tests referenced values (ETH,USDT,Ethereum) that are now valid enum entries, and the controller constructor signature changed to requireBitcoinServiceandRskNodeService.Model (
tx-history.model.ts)TOKENS: addedETH,USDT,USDC,DAI,WBTC,BNB,FIATNETWORKS: addedEthereum,BNB Smart Chain,Lightning Networkteks-stagingtoSOURCESliquidityProviderNamefromstringtoSourceenumController (
tx-history.controller.ts)BitcoinServiceandRskNodeServiceverifyTransactionExistsOnBlockchain— fetches BTC/RSK tx data and populatesfromAmount/userAddress; returnsnullon failure (skips store)verifyTransactionExistsInDatabase— short-circuits on duplicatetxHashstoreTransactionnow runs both checks before persistingUnit Tests (
tx-history.controller.unit.ts)BitcoinService.getTxandRskNodeService.getTransaction; updated constructor calltxHashto allstoreTransactionfixtures (now a required field)ETH/USDT→XRP,Ethereum→PolygonliquidityProviderName: 'Uniswap'→'LIFI'(must now be a validSource)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
public-node.testnet.rsk.co/home/REDACTED/work/_temp/ghcca-node/node/bin/node node node_modules/.bin/mocha --recursive dist/__tests__/**/*.unit.js --timeout 10000 /home/REDACTED/.cache/node-gyp/24.13.1/deps/v8/include -I /home/REDACTED/work/2wp-api/2wp-api/node_modules/secp256k1/node_modules/node-addon-api -I ../src --64(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node node_modules/.bin/mocha --recursive dist/__tests__/**/*.unit.js --timeout 10000(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
fix tests here, without change any other file
[Chronological Review: The conversation began with the user requesting to fix tests in the file `tx-history.controller.ts` without changing any other files. The user then canceled a previous command to delegate the task to a cloud agent, indicating a desire to handle the task directly.][Intent Mapping:
[Technical Inventory:
2wp-apisec/3.3.1maintx-history model assertion(PR tx-history model assertion #448) - This may relate to the user's current work on thetx-history.controller.tsfile.][Code Archaeology:
/Users/abraz/projetos/2wp-api/src/controllers/tx-history.controller.ts[Progress Assessment:
[Context Validation: All critical information for continuation is captured, including the user's focus on fixing tests in a specific file and their decision to handle the task themselves.]
[Recent Commands Analysis:
tx-history.controller.tsfile when the token budget was exceeded.1. Conversation Overview: - Primary Objectives: "fix tests here, without change any other file" - The user wants to correct tests in the `tx-history.controller.ts` file. - Session Context: The user initially requested to fix tests in a specific file and later canceled a command to delegate the task, indicating a desire to manage the task directly. - User Intent Evolution: The user shifted from considering delegation to taking personal responsibility for fixing the tests.- Technical Foundation:
- Repository:
- Current Branch:
- Default Branch:
- Active Pull Request:
- Codebase Status:
- File Name:
- Purpose: Contains logic for handling transactions.
- Current State: The user is focused on fixing tests in this file.
- Key Code Segments: Not specified yet as the user has not detailed the specific issues.
- Dependencies: Related to transaction handling and possibly linked to the active pull request.
- Problem Resolution:
- Issues Encountered: The user has not specified the exact issues with the tests.
- Solutions Implemented: None yet, as the user is in the process of identifying and fixing the tests.
- Debugging Context: Ongoing troubleshooting efforts are implied but not detailed.
- Lessons Learned: Not applicable yet as the user has not provided insights.
- Progress Tracking:
- Completed Tasks: None yet.
- Partially Complete Work: The user has initiated the task of fixing tests.
- Validated Outcomes: No outcomes have been validated yet.
- Active Work State:
- Current Focus: Fixing tests in the
- Recent Context: The user requested to fix tests and then canceled a delegation command.
- Working Code: No specific code snippets have been discussed yet.
- Immediate Context: The user was focused on fixing tests in the specified file.
- Recent Operations:
- Last Agent Commands: User requested to fix tests and canceled a command to delegate to a cloud agent.
- Tool Results Summary: No results were generated as the delegation command was canceled.
- Pre-Summary State: The agent was actively working on the user's request to fix tests when the token budget was exceeded.
- Operation Context: The user aimed to correct tests in the specified file without affecting other files.
- Continuation Plan:
- Pending Task 1: Fix tests in
- Pending Task 2: No additional tasks specified yet.
- Priority Information: The immediate focus is on fixing the tests in the specified file.
- Next Action: User should provide details on the specific tests that need fixing or any errors encountered.
2wp-apisec/3.3.1maintx-history model assertion(PR tx-history model assertion #448)tx-history.controller.tstx-history.controller.tsfile.tx-history.controller.ts- User needs to identify specific test issues.Created from VS Code.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.