Xud: Syntax err in `walletwithdraw` response

Created on 27 Aug 2020  路  8Comments  路  Source: ExchangeUnion/xud

Actual behaviour

simnet > walletwithdraw
xucli walletwithdraw [amount] [currency] [destination] [fee]

withdraws on-chain funds from xud

Options:
  --help             Show help                                         [boolean]
  --version          Show version number                               [boolean]
  --rpcport, -p      RPC service port                                   [number]
  --rpchost, -h      RPC service hostname                               [string]
  --tlscertpath, -c  Path to the TLS certificate of xud                 [string]
  --json, -j         Display output in json format    [boolean] [default: false]
  --xudir, -x        Data directory for xud                             [string]
  --amount           the amount to withdraw                             [number]
  --currency         the ticker symbol of the currency to withdraw.     [string]
  --destination      the address to send withdrawn funds to             [string]
  --fee              the fee in satoshis (or equivalent) per byte       [number]
  --all              whether to withdraw all available funds           [boolean]

Examples:
  xucli withdraw 0.1 BTC                    withdraws 0.1 BTC
  1BitcoinEaterAddressDontSendf59kuE
  xucli withdraw 0.1 BTC                    withdraws 0.1 BTC using 20 sats/byte
  1BitcoinEaterAddressDontSendf59kuE 20
  xucli withdraw --all --currency BTC       withdraws all BTC
  --address
  1BitcoinEaterAddressDontSendf59kuE

TypeError: Cannot read property 'toUpperCase' of undefined
    at /app/dist/cli/commands/walletwithdraw.js:44:39
    at Generator.next (<anonymous>)
    at /app/dist/cli/commands/walletwithdraw.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/app/dist/cli/commands/walletwithdraw.js:4:12)
    at Object.exports.handler (/app/dist/cli/commands/walletwithdraw.js:42:29)
    at Object.runCommand (/app/node_modules/yargs/lib/command.js:237:40)
    at Object.parseArgs [as _parseArgs] (/app/node_modules/yargs/yargs.js:1090:30)
    at Object.get [as argv] (/app/node_modules/yargs/yargs.js:1024:21)
    at Object.<anonymous> (/app/bin/xucli:43:3)

Expected result:
No the syntax err

P3 bug

All 8 comments

Want to check on this one? @rsercano

Of course :)

Another example I encountered today;

simnet > addpair HYDRO
xucli addpair <pair_id|base_currency> [quote_currency]

add a trading pair

Positionals:
  pair_id, base_currency  the pair ticker id or base currency[string] [required]
  quote_currency          the currency used to quote a price            [string]

Options:
  --help             Show help                                         [boolean]
  --version          Show version number                               [boolean]
  --rpcport, -p      RPC service port                                   [number]
  --rpchost, -h      RPC service hostname                               [string]
  --tlscertpath, -c  Path to the TLS certificate of xud                 [string]
  --json, -j         Display output in json format    [boolean] [default: false]
  --xudir, -x        Data directory for xud                             [string]

Examples:
  xucli addpair LTC/BTC  add the LTC/BTC trading pair by ticker id
  xucli addpair LTC BTC  add the LTC/BTC trading pair by currencies

TypeError: Cannot read property 'toUpperCase' of undefined
    at /app/dist/cli/commands/addpair.js:40:44
    at Generator.next (<anonymous>)
    at /app/dist/cli/commands/addpair.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/app/dist/cli/commands/addpair.js:4:12)
    at Object.exports.handler (/app/dist/cli/commands/addpair.js:28:29)
    at Object.runCommand (/app/node_modules/yargs/lib/command.js:237:40)
    at Object.parseArgs [as _parseArgs] (/app/node_modules/yargs/yargs.js:1090:30)
    at Object.get [as argv] (/app/node_modules/yargs/yargs.js:1024:21)
    at Object.<anonymous> (/app/bin/xucli:43:3)

Yep, that case should be fixed too.

Another example I encountered today;

simnet > addpair HYDRO
xucli addpair <pair_id|base_currency> [quote_currency]

add a trading pair

Positionals:
  pair_id, base_currency  the pair ticker id or base currency[string] [required]
  quote_currency          the currency used to quote a price            [string]

Options:
  --help             Show help                                         [boolean]
  --version          Show version number                               [boolean]
  --rpcport, -p      RPC service port                                   [number]
  --rpchost, -h      RPC service hostname                               [string]
  --tlscertpath, -c  Path to the TLS certificate of xud                 [string]
  --json, -j         Display output in json format    [boolean] [default: false]
  --xudir, -x        Data directory for xud                             [string]

Examples:
  xucli addpair LTC/BTC  add the LTC/BTC trading pair by ticker id
  xucli addpair LTC BTC  add the LTC/BTC trading pair by currencies

TypeError: Cannot read property 'toUpperCase' of undefined
    at /app/dist/cli/commands/addpair.js:40:44
    at Generator.next (<anonymous>)
    at /app/dist/cli/commands/addpair.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/app/dist/cli/commands/addpair.js:4:12)
    at Object.exports.handler (/app/dist/cli/commands/addpair.js:28:29)
    at Object.runCommand (/app/node_modules/yargs/lib/command.js:237:40)
    at Object.parseArgs [as _parseArgs] (/app/node_modules/yargs/yargs.js:1090:30)
    at Object.get [as argv] (/app/node_modules/yargs/yargs.js:1024:21)
    at Object.<anonymous> (/app/bin/xucli:43:3)

it may be a part of this issue - https://github.com/ExchangeUnion/xud/issues/1643.
For now u will get toUpperCase error or Assertione error for each command if u will pass incorrect type or incorrectly formatted string,

Can we fix these all in one?

To me I already suggested a catch mechanism on GRPC level before going to service layer but @sangaman pointed out it wouldn't make sense here: https://github.com/ExchangeUnion/xud/pull/1846#discussion_r486077194

So I'm okay whatever you guys decide

I see @sangaman 's point. Then let's catch the ones we know about, like this one here, and that's it for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

offerm picture offerm  路  4Comments

kilrau picture kilrau  路  4Comments

kilrau picture kilrau  路  5Comments

kilrau picture kilrau  路  4Comments

kilrau picture kilrau  路  6Comments