-
Notifications
You must be signed in to change notification settings - Fork 300
refactor: migrated generateWallet to typed routes #7052
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
base: master
Are you sure you want to change the base?
refactor: migrated generateWallet to typed routes #7052
Conversation
16a0cd0
to
96dd8d5
Compare
const coin = bitgo.coin(req.decoded.coin); | ||
const result = await coin.wallets().generateWallet(req.body); | ||
if (req.query.includeKeychains === 'false') { | ||
if ((req.decoded.includeKeychains as any) === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we casting to any here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because includeKeychains
is type BooleanFromString
which has output type string so statically it is typed as a string but during runtime it is actually a boolean. I think this is because of how we setup the decoder.
Also includeKeychains
is a parameter in the request and httpRequest
requires that params
are of type string
fb1254e
to
678e891
Compare
added keychain codecs to a general codec file, as I assume that these codecs could be reused (but not sure if they will). refactored the UT that covered generateWallet to ensure that encoding and decoding works e2e.
TICKET: WP-5415