-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Grammar #1
Conversation
out < 10000 | ||
{ | ||
match value { | ||
case 1 -> SimpleState (return value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does SimpleState
represent here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Represents no storage state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - I did not find the definition though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Extends” means that a VotingModel
is binded to one specific BeginModel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is simple OOP concept. "Extends" = "inherits"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Balance of what? E.g. in Algorand account’s balance comprise ALGOs and eventually other tokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this is requires some additional thinking since I assumed that, as in EVM, balance refers to the native token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.