jmrossy / celo-web-wallet

Othello: A lightweight, self-sovereign wallet for the Celo network. Runs on the web and on desktop.
https://celowallet.app
MIT License
45 stars 28 forks source link

More descriptive error voting for >10 val groups #41

Open jmrossy opened 3 years ago

jmrossy commented 3 years ago

Feature Description

The limit is 10: https://github.com/celo-org/celo-monorepo/blob/master/packages/protocol/contracts/governance/Election.sol#L260

The current error is unclear (generic tx error)

ghost commented 3 years ago

So by more descriptive you mean concatenate the number after the msg, the limit being maxNumGroupsVotedFor? Something like: "Voted for too many groups, please limit number of groups to 10(let's say)"?

jmrossy commented 3 years ago

So by more descriptive you mean concatenate the number after the msg, the limit being maxNumGroupsVotedFor? Something like: "Voted for too many groups, please limit number of groups to 10(let's say)"?

Yeah something like that. We should add a condition in the validate method to catch this even before the user attempts the tx: https://github.com/celo-tools/celo-web-wallet/blob/master/src/features/validators/stakeToken.ts#L39