-
Notifications
You must be signed in to change notification settings - Fork 14
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
All Vote Validation (Except Signature) #47
Conversation
* Fetch user tokens from poap api and compare them to the tokens being submitted with the vote * Endpoint smoke tests for incorrect token vote creation
All tests pass, but I did get an issue when using it on the frontend. Submitting a vote failed with the error message
Let me know how you want to resolve this, as it seems there are a few different options here. Also one small thing is that some of the error messages are a bit confusing. Two examples:
Similarly, with "Account or token cannot vote twice" perhaps we should specify the offending token ID? |
Unless I've gotten myself confused and I'm thinking of it wrong, I think this has to be the ID of the NFT coming from the front end. The user might, for example, own two tokens from the same event. And we would want to identify the tokens by their NFT Id to ensure no specific token has ever voted twice. Does that make sense? Apologies if I ever communicated that wrong to you in the past. Entirely possible I did. Should be a pretty easy fix on the frontend, right? The poap API hands back both the token & event Ids. Mind pushing a commit that updates it?
Good call, I will update this.
Yes, this would be better, but because of the way I've structured this check (using one big query) it would take some logic changes that I don't think are worth it for now. |
Ah, didn't realize you could have (or would want to count) multiple tokens from one event. I was using event ID on the front end to match it up with qualifying events, but since it's not necessarily one token per event then this would undercount votes. Will push an update in a few minutes where |
Great, thanks! Just pushed a commit with better error messages. If all looks good and the frontend is working, feel free to merge 👍 |
Run
npm test
. Should not require any migrations. Runnpm run dev
Should work with seamlessly with the UI w/o modifications.Closes #9