feat: adding TRS balance property to wallet#2252
Conversation
This property is required for reporting features CLOSES Ticket: BG-45329
Codecov Report
@@ Coverage Diff @@
## master #2252 +/- ##
===========================================
+ Coverage 0 52.61% +52.61%
===========================================
Files 0 6 +6
Lines 0 574 +574
Branches 0 94 +94
===========================================
+ Hits 0 302 +302
- Misses 0 262 +262
- Partials 0 10 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| * | ||
| * This is useful when balances have the potential to overflow standard javascript numbers | ||
| */ | ||
| trsBalanceString(): string { |
There was a problem hiding this comment.
I'm not sure how this solves the problem in the ticket. Probably missing some context. Can you expand on how these new fields are utilized with an example?
There was a problem hiding this comment.
Sure, these wallet objects are passed back to bga when executing the wallet command and then used to display the result:
https://github.com/BitGo/bitgo-admin/blob/master/src/handlers/wallet.js#L151
I wanted to add the property to the object instead of doing a direct property reference on a undeclared field. The TRS balance field will go right below the other 3 balances that get printed.
This PR will work in tandem with 2 other PRs to achieve this. Here is the PR that will populate that new field:
https://github.com/BitGo/bitgo-microservices/pull/18313/files#diff-008ef6124f852724918acc1cb7c461bd3409c7afae62c2740b9952e00f81fd94R417
There was a problem hiding this comment.
To make sure, these are fields that only for bga?
There was a problem hiding this comment.
I'm in agreement with @tylerlevine's latest comment. Since this is internal only on an open source project, the code should be implemented internally per Tyler's comment.
tylerlevine
left a comment
There was a problem hiding this comment.
This should not be part of the public facing API - if we want to get a balance from TRS, it should be optional (and opted into via a query param or request body option) and should replace the balanceString.
We can't expect customers to know what trs is, and we should not be exposing internal service names through the public API in this way. I'll leave more comments on the wallet platform change.
|
Works in tandem with the following changes: |
Got it @tylerlevine, what you are saying makes sense. I will work on making updates and see what I come up with. I need to clarify if it is ok to replace balanceString completely in the bga output. |
|
No longer needed |
This property is required for reporting features
CLOSES Ticket: BG-45329