-
Notifications
You must be signed in to change notification settings - Fork 61
Bounty rewards consolidation #714
Bounty rewards consolidation #714
Conversation
✅ Deploy Preview for ubiquibot-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Currently I feel like the code is messy and unreadable. Could you refactor it to make it easier to read? I feel like the names for some variables and functions are off.
Ideally I'd like to see a top level function incentivesCalculation
that first checks if all conditions are met (not empty private key, issued closed as completed, is bounty, autopay is not off, and so on), then it should get all the issue comments (to avoid retrieving them multiple times).
After that it should call three function calculateIssueCreatorReward
, calculateIssueConversationReward
and calculateIssueAssigneeReward
, all of them receive comments and return something like { user_id, username, reward }[]
, then the main function can aggregate all rewards together, apply multipliers, deduct penalties, retrieve user's wallet and generate permits.
I hope you understand what I mean. Let me know if you have questions
I get what you mean, I thought about it and creating a function to aggregate all makes sense. |
@whilefoo check it out now |
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.
can you avoid using !
assertion?
When they're null, the error is returned and it doesn't get to the functions anyway. Only way to get rid of it is create an if else statement to check every value and it's going to be messy |
Done already |
Cool, could you provide a QA for consolidation of all? |
@wannacfuture I made some more changes to merge the reviewer and commenter, unlike the last permit. Because it can only be one permit per user. |
What's the update @0xcodercrane |
It's been merged but waiting for other reviewer's approval. |
Taking too long |
I still can see your requests have not been resolved yet @whilefoo. |
I've resolved his requests, except he has another. |
@0xcodercrane ping |
Resolves #704
There are 2 exceptions:
Issue solver shouldn't get issue commenter rewards - QA 1
Issue creator shouldn't get issue commenter rewards - QA 2
Assignee and Creator Reward Consolidated - QA 3
All QA (Including PR Review): one-two-test/one#12
Merging Reviewer and Commenter: one-two-test/one#12 (comment)