Conversation
| out < 10000 | ||
| { | ||
| match value { | ||
| case 1 -> SimpleState (return value), |
There was a problem hiding this comment.
What does SimpleState represent here?
There was a problem hiding this comment.
Represents no storage state
There was a problem hiding this comment.
Ok - I did not find the definition though
There was a problem hiding this comment.
Oh, right, My bad; I changed the function's signature. Yeah, there should be no state mutation returned.
| }; | ||
|
|
||
| state ExecuteState(ExecuteModel) from RevealState st { | ||
| current_block > RevealModel.end_block |
There was a problem hiding this comment.
Imo we should also check that all voters have revealed their commitment. Otherwise I would trigger an error / invalidate the voting
There was a problem hiding this comment.
We can not guarantee that all voters will reveal their voters, otherwise the reveal stage will be stalled forever.
There was a problem hiding this comment.
Nope we can't. But, we can check that at least a threshold has been reached within a certain time. Otherwise abort the voting.
| voter.size <= max_size | ||
| } | ||
|
|
||
| // Voting model extends `BeginModel` and its guards |
There was a problem hiding this comment.
“Extends” means that a VotingModel is binded to one specific BeginModel?
There was a problem hiding this comment.
No, this is simple OOP concept. "Extends" = "inherits"
There was a problem hiding this comment.
Got it - so if I have an instantiation for a VotingModel it inherits from BeginModel the same proposal, right?
In other terms: proposal looks like an identifier that must be the same for each model.
There was a problem hiding this comment.
Yes, it simply inherits
start_block: int,
end_block: int,
voters: Set<Address>,
proposal: String,
max_size: int
fields from the BeginModel. It doesn't mean the values are automatically inherited. It is up to the developer to specify what are the values of the VotingModel fields during state transition: they can be passed from the BeginModel or the new ones can be set.
There was a problem hiding this comment.
Ok but I guess that state transitions must ensure that some values remain consistent from one model to another
| start_block > (current_block + 10), | ||
| end_block > (start_block + 10), | ||
| //voters balance should greater than 1000 tokens | ||
| voters.balance > 1000, |
There was a problem hiding this comment.
Balance of what? E.g. in Algorand account’s balance comprise ALGOs and eventually other tokens.
There was a problem hiding this comment.
Okay, this is requires some additional thinking since I assumed that, as in EVM, balance refers to the native token.
No description provided.