Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

named parameter obfuscate issue in methods.js #61

Closed
randydu opened this issue Feb 6, 2018 · 2 comments
Closed

named parameter obfuscate issue in methods.js #61

randydu opened this issue Feb 6, 2018 · 2 comments

Comments

@randydu
Copy link

randydu commented Feb 6, 2018

When calling api with named parameter (such as signRawTransaction), the params is now an object instead of an array, so the obfuscate methods (in dist/src/methods.js) will throw the following exception:

Exception has occurred: TypeError
TypeError: params is not iterable
    at request (/home/randy/blockdev/docker/app/node_modules/bitcoin-core/dist/src/methods.js:346:47)
    at obfuscateRequestBody (/home/randy/blockdev/docker/app/node_modules/bitcoin-core/dist/src/logging/request-obfuscator.js:82:17)
    at obfuscateRequest (/home/randy/blockdev/docker/app/node_modules/bitcoin-core/dist/src/logging/request-obfuscator.js:104:20)
    at obfuscate (/home/randy/blockdev/docker/app/node_modules/bitcoin-core/dist/src/logging/request-obfuscator.js:132:3)
    at /home/randy/blockdev/docker/app/node_modules/bitcoin-core/dist/src/logging/request-logger.js:24:36
    at Request.<anonymous> (/home/randy/blockdev/docker/app/node_modules/@uphold/request-logger/src/index.js:74:9)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at Request.start (/home/randy/blockdev/docker/app/node_modules/request/request.js:859:8)
    at Request.write (/home/randy/blockdev/docker/app/node_modules/request/request.js:1498:10)
    at end (/home/randy/blockdev/docker/app/node_modules/request/request.js:546:18)
    at Immediate.<anonymous> (/home/randy/blockdev/docker/app/node_modules/request/request.js:575:7)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

The obfuscate.request needs to detect the params type (array of object) to support named params calling.

@ruimarinho
Copy link
Owner

You're right. @pedrobranco are you able to take a look on this one?

@pedrobranco
Copy link
Collaborator

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants