Using "vote()" on the Election.sol Celo Smart Contract #1913
-
ContextBuilding a Celo staking dApp that interacts with Celo smart contracts directly. The rough steps for that are:
From digging around the code a little, it seems like ProblemMy strategy for getting proper values for What's interesting is that when I query this method, it doesn't seem to be returning the full set of validator groups. Specifically I'm looking for To double-check, I also queried AsksCould use some help understanding how to get around this. If there is a better way to query the Also made a post on the Celo Discord about this here: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As you find out, the idea between the The For what I'm checking right now, this address Let me know if your issue persist. For the way to calculate the lesser and greater, you can check what we are doing in the contractKit (also, if you are developing something in javascript/typescript I encourage you to use it): |
Beta Was this translation helpful? Give feedback.
As you find out, the idea between the
lesser
andgreater
is to avoid that computation in the contract and basically make that call cheaper (gas/computation)The
validatorgroup:list
shows every validatorgroup in existence, but the eligible, shows only the ones that have at least 1 validator.For what I'm checking right now, this address
0xEba452a3fACad973d03DAab5ca158C286c59A540
is part of the response of thegetTotalVotesForEligibleValidatorGroups
call forbaklava
. Just a guess, but maybe when you queried that method, the group didn't have any validator.Let me know if your issue persist.
For the way to calculate the lesser and greater, you can check what we are doing in the contractKit (…