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

[ERTP] Design Changes (to be split up into issues per task) #385

Closed
katelynsills opened this issue Jan 7, 2020 · 5 comments · Fixed by #523
Closed

[ERTP] Design Changes (to be split up into issues per task) #385

katelynsills opened this issue Jan 7, 2020 · 5 comments · Fixed by #523
Assignees
Labels
ERTP package: ERTP
Milestone

Comments

@katelynsills
Copy link
Contributor

  1. Rename assay to issuer
  2. Rename mint to issuerAdmin
  3. As part of the process of making an issuer and issuerAdmin, create a brand object. The brand is shared by the issuer, issuerAdmin, purses, and payments of a particular kind. See item 4 for why this is helpful for removing an anti-pattern of use. The brand should have a method that takes an issuer as a parameter and returns a boolean, stating whether the issuer belongs to that brand. This is to avoid issuers picking up another issuers brand and passing themselves off as that brand.
  4. Move nearly all of the methods from purses and payments to the issuer. The only methods that should remain are getMemo (to get a string message for that particular payment or purse), and getAllegedBrand, which returns an object which is the brand. In particular, we want to remove the getAssay/getIssuer pattern that we have seen, where a person receives a payment that should not be relied on, and then they get their assay/issuer (which they normally should be able to rely on) from the untrusted payment. Being able to get an object that you should be able to rely on from an object that you should not be able to rely on is an anti-pattern.
  5. Rename units to amount
  6. Rename unitOps to amountOperations
  7. In amountOperations, we want to simplify as much as possible so that it is very clear that an amount is merely a branded extent/quantity etc. This means getting rid of the description for now. We should also clarify the use of a WeakSet as a cache so that it is known to be nothing special, just a performance enhancement.
  8. Rename extent to ?? (unbrandedAmount, quantity)?
  9. In what was formerly unitOps, rename with to add
  10. In unitOps, Rename without to subtractNonNeg or something similar. (Note: we cannot use subtract on its own because our version is not set subtraction. If the left does not contain the right, we must throw an error. For natural numbers as in the case of fungible tokens, we throw if the subtraction results in a negative number.)
  11. In unitOps, rename includes to isGTE
@katelynsills katelynsills added the ERTP package: ERTP label Jan 7, 2020
@katelynsills
Copy link
Contributor Author

There's an experimental branch that has some of these changes: https://github.com/Agoric/agoric-sdk/tree/branded-operations-strip-for-parts

It has other changes that we probably don't want and needs to be stripped for parts.

@dtribble
Copy link
Member

dtribble commented Feb 5, 2020

A couple of naming convention proposals:

  • "alleged" methods use that instead of get, so allegedBrand rather than getAllegedBrand
  • the extentOps methods should sound internal, e.g., doAdd
  • name unitOps unitMath, to resonate with Math, which is known to have helper functions that are math-oriented.

@katelynsills
Copy link
Contributor Author

Naming changes based on design session Feb 11:

assay -> issuer
mint remains the same, but we mention it is just a facet of issuer
unitOps -> math
extentOps -> mathHelpers
extentOps function names -> "do" prefix
units -> amount
extent renames the same

@erights
Copy link
Member

erights commented Feb 11, 2020

I was thinking unitOps -> amountMath. I'm not comfortable with unqualified math.

@katelynsills
Copy link
Contributor Author

I was thinking unitOps -> amountMath. I'm not comfortable with unqualified math.

Good point. You're right. That's what we had said

@katelynsills katelynsills self-assigned this Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ERTP package: ERTP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants