-
Notifications
You must be signed in to change notification settings - Fork 43
feat: refine work with membership info and other meta information #2341
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
base: master
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
197ba46
to
d0da8f8
Compare
a824fff
to
08af18e
Compare
@danisharora099 can you create an issue capturing this problem(s)? and can you, please, make PR name more informative? |
} | ||
|
||
public async withdraw(token: string, holder: string): Promise<void> { | ||
public async withdraw(token: string, from: string): Promise<void> { |
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.
if from
wallet address? if so, I would name it like this
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.
Like? :D
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.
like wallet
;)
) { | ||
private async validateRateLimit(rateLimit: number): Promise<void> { | ||
const [minRate, maxRate] = await Promise.all([ | ||
this.contract.minMembershipRateLimit(), |
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 something that doesn't change during lifecycle of the contract once it is deployed, I believe
if I am not wrong, then you should fetch this value when contract instance gets instantiated
for that I would recommend using a static method similarly how it is done here
https://github.com/waku-org/js-rln/blob/f6d5deb8cb51602b2b544de5de5b88de96e11aef/src/contract/rln_contract.ts#L56
after that this method becomes sync again
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.
Done here: 10aadbe
} | ||
|
||
// Initialize members and subscriptions | ||
this.fetchMembers() |
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 would recommend to improve it even further and:
- use similar approach to https://github.com/waku-org/js-rln/blob/f6d5deb8cb51602b2b544de5de5b88de96e11aef/src/contract/rln_contract.ts#L56 for both contract implementations;
- inject an instance of base contract into specific contract and not use
extend
@weboko can you please highlight which comments are blocking comments, and which are nits that aren't as important? |
a7f52e4
to
6d86b6f
Compare
Problem / Description
There are a few problems with the current adapter:
idCommitment
is a stringified hexgetMembershipInfo
doesn't return all available membership info fieldsvalidateRateLimit
validates the upper and lower bounds defined in the adapter, instead of the contractSolution
bigint
foridCommitment
instead ofstring
getMembershipInfo
to fetch, and return, ALL available dataNotes
Checklist