-
Notifications
You must be signed in to change notification settings - Fork 214
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
9220 deprecate getDisplayInfo #9221
Conversation
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.
I'm in favor of dropping decimalPlaces from Brands.
@@ -470,6 +470,7 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => { | |||
trace('observing'); | |||
|
|||
void E.when( | |||
// FIXME can this work without decimalPlaces? if so, read from boardAux |
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 doesn't need decimalPlaces, but would need some scaling factor to replace it. It could use BASIS_POINTS or MILLIONS instead. It just needs something so the resolution of the response is at least nominal. Asking for price quotes on Satoshis or smallest fraction of BLD wouldn't be workable.
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 does the code look up getDisplayInfo if a nominal scaling factor suffices? Could this just skip the lookup and use DEFAULT_DECIMALS
?
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.
I think a nominal factor would suffice. When this was built, I didn't think deeply enough to be sure that a nominal factor would be fine, and we had getDisplayInfo, much as I would have preferred that we didn't.
@michaelfig seems to have pointed to some places where he wanted to know what the actual "unit amounts" were. (i.e. "what is the unit of currency?") But for the auction's goals, it just needs to ensure it's not asking for pricing on an amount small enough that the answer won't have sufficient resolution. I think DEFAULT_DECIMALS is good enough for that.
@@ -171,6 +171,7 @@ export const registerScaledPriceAuthority = async ( | |||
]), | |||
]); | |||
|
|||
// FIXME can this work without decimalPlaces? if so, read from boardAux |
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.
I suspect this usage requires decimalPlaces
. (cc @michaelfig)
// FIXME can this work without decimalPlaces? if so, read from boardAux
This seems backwards. If it can work w/o dp, then it should. If it can't, then it needs an alternative source like boardAux.
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.
I think my description of "unit amounts" as decimalPlaces
is causing confusion. I wrote that description when the only source of "unit amount" information was getDisplayInfo().decimalPlaces
. The code below can be made to work without getDisplayInfo()
, if some alternative like boardAux
conveys the same information. But the functionality provided by the code needs some source of "unit amounts".
@@ -171,6 +171,7 @@ export const registerScaledPriceAuthority = async ( | |||
]), | |||
]); | |||
|
|||
// FIXME can this work without decimalPlaces? if so, read from boardAux |
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.
I think my description of "unit amounts" as decimalPlaces
is causing confusion. I wrote that description when the only source of "unit amount" information was getDisplayInfo().decimalPlaces
. The code below can be made to work without getDisplayInfo()
, if some alternative like boardAux
conveys the same information. But the functionality provided by the code needs some source of "unit amounts".
f9e0b24
to
028bc5a
Compare
Deploying agoric-sdk with Cloudflare Pages
|
I've punted removal to #10235 and left this one as just about deprecation |
4413fb6
to
fff76f3
Compare
closes: #9220
Description
Deprecate
getDisplayInfo
so we don't use it more.Point TODOs to removing it: #10235
Removes the use in auctionBook by using a fixed scaling factor
Also converts the JSDoc types to
.ts
so@deprecated
can be usedSecurity Considerations
None yet but #10235 will change the source of decimal places
Scaling Considerations
none
Documentation Considerations
https://docs.agoric.com/reference/ertp-api/brand.html#abrand-getdisplayinfo will need updating.
Testing Considerations
Upgrade Considerations