-
Notifications
You must be signed in to change notification settings - Fork 226
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
feat!: add a claimsRegistrar based on attestations #3622
Conversation
d2d2be3
to
965f471
Compare
3d41b99
to
28ac865
Compare
48fd832
to
1eb2464
Compare
28ac865
to
da2bf29
Compare
402c207
to
185ba61
Compare
da2bf29
to
44666f5
Compare
185ba61
to
d223b80
Compare
44666f5
to
d44be4d
Compare
d223b80
to
53599c2
Compare
d44be4d
to
1596547
Compare
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.
after poring over the code, I packaged up a bunch of suggestions in #3932
What's here is a good step forward with or without those suggestions.
// has a persistent handle that survives through extending the duration of the | ||
// lien and augmenting the number of shares it represents. This contract makes |
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.
"the lean"? What does that definite description refer to?
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'll assume "the lean" is auto-corrupted from "the lien".
There's an underlying lien for the tokens represented in the go-code. When the holder extends the duration (locks up for an extended period) or adds to the deposited tokens, the attestation contract makes sure to use the same identity, so that attestation payments are re-usable without confusing vote counters, even though the value locked or duration of the lock can change over time.
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 sort of a copy-editing / tech writing comment. Whenever I see a definite description that doesn't have a clear referent, my mind flags it like a compiler error. Usually making the referent clear is straightforward, but sometimes the ill-formed definite description is a sign of a larger problem with the text or even the design, as if we were referring to "the solution to the equation" when there may in fact be none or more than one.
My first reaction to this comment was to wonder what it is about; i.e. what it is documenting. It would make sense to make it a /**
JSDoc comment on start
or to use JSDoc's @file
. But we've had that discussion before, so I let that go.
Then I bumped over "shareHolders is ..." -- a plural subject with a singular verb. But OK, I can read it as "The shareHolders contract is..." or some such.
Then "relies on an attestation contract" reminds me of a long-standing issue I've had with the platform: what is a contract? I know what a bundle, an installation, and an instance are. I read it as an instance in this case. The instance isn't in the terms, but a corresponding brand is, and it's clear enough how they relate after reading attestation/expiring/expiringNFT.js
and such.
"to ensure that only valid holders of shares have the ability to vote" somewhat raises the question of what a valid holder of a share is; on the other hand, it defines it in terms of capabilities. So very well.
"each votable share has a persistent handle" sounds at first like if I have 1000 shares then I get 1000 handles. Perhaps "... for every votable share, there is a persistent handle..." would be better, but I figured it out by reading attestation.js
etc. and forgot to comment on that part.
But then we get to "extending the duration of the lien" and nothing in this comment introduced a lien into the discussion.
"the attestations" follows "an attestation contract" soon enough to allude to it, though on review, it's not clear enough to serve as a specification.
I wonder if it would be cost-effective for this comment to start with attestationBrand
and tell the rest of the story from there.
In the end, my code review bar is: am I OK maintaining this code? If I'm called on to work on this file, there's a good chance I'll refine that comment. But I think I understand it well enough to endorse the code as-is.
packages/governance/src/types.js
Outdated
/** | ||
* @typedef {Object} CommitteeElectoratePublicMixin | ||
* @property {() => string} getName | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} ClaimsElectorateMixin | ||
* @property {() => ERef<Invitation>} makeVoterInvitation | ||
*/ | ||
|
||
/** | ||
* @typedef { ElectoratePublic & ClaimsElectorateMixin } ClaimsElectoratePublic | ||
* @typedef { ElectoratePublic & CommitteeElectoratePublicMixin } CommitteeElectoratePublic | ||
* @typedef { ClaimsElectoratePublic | CommitteeElectoratePublic } AnyElectoratePublic | ||
*/ |
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.
Making up all these names for things we only use once only makes the code harder to read, to my mind. I suggest:
/** | |
* @typedef {Object} CommitteeElectoratePublicMixin | |
* @property {() => string} getName | |
*/ | |
/** | |
* @typedef {Object} ClaimsElectorateMixin | |
* @property {() => ERef<Invitation>} makeVoterInvitation | |
*/ | |
/** | |
* @typedef { ElectoratePublic & ClaimsElectorateMixin } ClaimsElectoratePublic | |
* @typedef { ElectoratePublic & CommitteeElectoratePublicMixin } CommitteeElectoratePublic | |
* @typedef { ClaimsElectoratePublic | CommitteeElectoratePublic } AnyElectoratePublic | |
*/ | |
/** | |
* @typedef { ElectoratePublic & {makeVoterInvitation: () => ERef<Invitation>} } ClaimsElectoratePublic | |
* @typedef { ElectoratePublic & {getName: () => string} } CommitteeElectoratePublic | |
*/ |
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.
That is simpler for this case. It feels like if there were more than one added method, we'd need to break it out for readability anyway. Do you think the in-line approach would apply more generally?
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.
Do you think the in-line approach would apply more generally?
I do, though I gather it goes against an established norm to some extent.
1a5d557
to
3ca89e8
Compare
I incorporated the suggestions from #3932, though not always the way you wrote them. |
d13c4d0
to
c49e0fc
Compare
Cool. That's the spirit in which they were offered. |
e7c329e
to
97f1d53
Compare
c49e0fc
to
fac3167
Compare
97f1d53
to
6ce7f17
Compare
fac3167
to
08b18a3
Compare
Agents who can deposit an attestation payment will get the ability to vote that amount. refactor common registrat code to a library tests that BinaryBallotCounter can count these votes.
more handles have capitalized names than not. Suggestions from #3932
97dba58
to
aea80f1
Compare
Agents who can deposit an attestation payment will get the ability to vote that amount.
refactor common registrat code to a library
tests that BinaryBallotCounter can count these votes.