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

9220 deprecate getDisplayInfo #9221

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

turadg
Copy link
Member

@turadg turadg commented Apr 10, 2024

closes: #9220

Description

  • get input from @Chris-Hibbert before pursuing further
  • address FIXMEs (read from boardAux instead)

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

E(issuer).getDisplayInfo(),
E(issuer).makeEmptyPurse(),
]);
const [purse] = await Promise.all([E(issuer).makeEmptyPurse()]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [purse] = await Promise.all([E(issuer).makeEmptyPurse()]);
const [purse] = await E(issuer).makeEmptyPurse();

I doubt there is ever any point to a singleton call to Promise.all

Copy link
Member Author

@turadg turadg Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this was just a draft. I'm looking for feedback on the approach and consequences. wrt syntax,

Suggested change
const [purse] = await Promise.all([E(issuer).makeEmptyPurse()]);
const purse = await E(issuer).makeEmptyPurse();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the overall approach. I love that you moved the ERTP types, with comments, from types.js to types.d.ts. typedoc FTW!

Beyond that, I like all the changes outside ERTP, including the FIXME question. I'm curious about the answer. Because I'm not sure that deprecating brand.getDisplayInfo() is the right thing to do. But I find it plausible.

I recommend proceeding forward. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt there is ever any point to a singleton call to Promise.all

I think of it as akin to the dangling comma on single-argument method calls, i.e. to reduce churn in formatting in places were there were multiple operands, and might be again. Do people believe that automated reformatting makes that concern moot?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moot enough, yes. The only remaining gotcha is git's text-line based diff and merge algorithms. But IMO we should not distort our programs too much to accommodate these algos being at the wrong abstraction level. Focus on the human reader/reviewer first.

issuerP,
E(brand).getDisplayInfo(),
]);
const [issuer] = await Promise.all([issuerP]);
Copy link
Member

@erights erights Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [issuer] = await Promise.all([issuerP]);
const issuer = await issuerP;

Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a 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.

Comment on lines +18 to +19
};
/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the lack of blank lines between def'ns intentional?

Suggested change
};
/**
};
/**

@@ -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
Copy link
Contributor

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.

@@ -171,6 +171,7 @@ export const registerScaledPriceAuthority = async (
]),
]);

// FIXME can this work without decimalPlaces? if so, read from boardAux
Copy link
Contributor

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.

Copy link
Member

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
Copy link
Member

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
// We need "unit amounts" of each brand in order to get the ratios right. You
// can ignore decimalPlaces when adding and subtracting a brand with itself,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// can ignore decimalPlaces when adding and subtracting a brand with itself,
// can ignore "unit amounts" when adding and subtracting a brand with itself,

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

Successfully merging this pull request may close these issues.

deprecate getDisplayInfo
4 participants