feat: implement realm for manual rewards#171
feat: implement realm for manual rewards#171harry-hov wants to merge 6 commits intognoverse:mainfrom
Conversation
👷 Deploy request for gnochess-signup-form pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for gnochess ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Makefile
Outdated
| cd web; npm run dev | ||
|
|
||
| 4_deploy_realm: ## Deploy GnoChess realm on local node. | ||
| 4_deploy_chess_realm: ## Deploy GnoChess realm on local node. |
There was a problem hiding this comment.
i think we should just keep a single 4_deploy_realm rule that uploads as many realm as needed (two at the moment).
There was a problem hiding this comment.
Yeah. makes sense. Done.
|
if we go with moving |
00b6e7b to
4927740
Compare
416325f to
0779a24
Compare
|
|
||
| // XXX: Update as required | ||
| var whitelist = []string{ | ||
| "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", |
There was a problem hiding this comment.
do we already have an admin address shared with the competition operators? if not we should set it now.
| "gno.land/p/demo/ufmt" | ||
| ) | ||
|
|
||
| var entries avl.Tree // address -> *RewardEntry |
There was a problem hiding this comment.
It prevents a single address from having multiple entries.
We can survive with this condition, but I think it makes sense for such manual entry realm to support multiple entries per address.
There was a problem hiding this comment.
I don't think it's a good idea to have multiple entries for single address.
Btw you can always override points (increase/decrease).
For some reason we want entry for every points earner. we can have something like:
// RewardEntry represents a reward entry
type RewardEntry struct {
address std.Address
totalPoints uint64
points []*Point
updatedAt time.Time
updatedBy std.Address
}
type Point struct {
points uint64
reason string
}Considering the time constrains, I suggest we shouldn't make things unnecessarily complex, unless it is need of the hour
moul
left a comment
There was a problem hiding this comment.
could you add at least one unit test so that gno test runs against the folder and make basic checks like syntax, etc?
I think you can make a simple test adding a few entries and checking the result of Render(); no need to test the whitelisting feature IMO.
Done @moul. |
| pull_request: | ||
| paths: | ||
| - "realm/**" | ||
| - "r/**" |
There was a problem hiding this comment.
please rebase and also fix for .github/workflows/deploy-realm.yml
There was a problem hiding this comment.
Done -> Can you please verify the changes? -> 0f83b2d
9660391 to
0f83b2d
Compare
Contains initial implementation for manual reward entry
(as mentioned in 2nd point of #159)
Note:
Please check if moving
realm->r/chessbreaks anything