bcoin-org / bclient

Bcoin node and wallet clients
Other
11 stars 20 forks source link

fix signTX #6

Closed pinheadmz closed 6 years ago

pinheadmz commented 6 years ago

was returning this error:

$ bwallet-cli sign --id=$id --passphrase=$passphrase --tx=$tx
AssertionError [ERR_ASSERTION]: false == true
    at WalletClient.request (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/node_modules/bcurl/lib/client.js:164:5)
    at WalletClient.post (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/node_modules/bcurl/lib/client.js:234:17)
    at WalletClient.sign (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/lib/wallet.js:357:17)
    at Wallet.sign (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/lib/wallet.js:793:24)
    at CLI.signTX (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/bin/bwallet-cli:333:34)
    at CLI.handleWallet (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/bin/bwallet-cli:545:20)
    at CLI.open (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/bin/bwallet-cli:676:17)
    at /home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/bin/bwallet-cli:687:13
    at Object.<anonymous> (/home/ec2-user/node-v8.11.1-linux-x64/lib/node_modules/bclient/bin/bwallet-cli:690:3)
    at Module._compile (module.js:652:30)

This PR updates the syntax to match the neighboring functions, and the API call returns a expected output. NEEDS REVIEW! I'm not sure it's totally doing what it's supposed to!