BitGo/BitGoJS

Error on account consolidation

Closed this issue · 1 comments

The consolidateAccount is breaking on BitgoExpress V9.31.0

Environment Details

  • OS: buster-slim
  • Node Version: node:20
  • Yarn Version:
  • BitGoJS Version: 9.31.0
  • BitGo Environment: testnet

Expected Behavior

Consolidate ttrx wallet with deposit addresses funds

Current Behavior

{
    "error": "Cannot read properties of undefined (reading 'failure')",
    "message": "Cannot read properties of undefined (reading 'failure')",
    "bitgoJsVersion": "19.6.0",
    "bitgoExpressVersion": "9.31.0"
}

Logs from container:

10.0.10.28 - local_express [28/Nov/2023:15:41:51 +0000] "POST /api/v2/ttrx/wallet/655cc068d78a5de7f8869fb90d3e316d/consolidateAccount HTTP/1.1" 404 191 "-" "PostmanRuntime/7.35.0"
7
error 500: Cannot read properties of undefined (reading 'failure')
6
TypeError: Cannot read properties of undefined (reading 'failure')
5
    at handleV2ConsolidateAccount (/var/bitgo-express/dist/src/clientRoutes.js:663:16)
4
    at runMicrotasks (<anonymous>)
3
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2
    at async promWrapper (/var/bitgo-express/dist/src/clientRoutes.js:999:28)

Possible Solution

Steps to Reproduce

  1. Create a TTRX wallet
  2. Initialize it with TRX
  3. Create a deposit address
  4. Fund the deposit address with TRX
  5. Call endpoint

@pplanel Thanks for reporting this, i recently added some error handling for this issue
#4106

This happens when there is no enough balance to consolidate in any receive address.
Here is the latest express version: 9.50.0