Repository navigation
feat(platform)!: yes/no masternode vote poll kind with supermajority and minimum voting power #4899
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
Merged
+9,651
−515
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
db5cc32
feat(platform)!: yes/no masternode vote poll kind with supermajority …
QuantumExplorer d6c4092
fix(dpp): a resource vote naming a yes/no poll is inactive before pro…
QuantumExplorer 44545be
Merge v4.2-dev (#4930, #4931) into the yes/no vote poll branch
QuantumExplorer d7f783e
fix(platform): yes/no poll review fixes: end-date clean-up, proof rou…
QuantumExplorer b8fb0a1
feat(platform)!: a yes/no poll's minimum is a fixed voting power or a…
QuantumExplorer 49df27f
feat(dpp): round a yes/no poll's share minimum down plus one or up mi…
QuantumExplorer 1285ffe
Merge v5.1-dev into the yes/no vote poll branch, moving it to protoco…
QuantumExplorer d6f5d96
fix(platform): apply the yes/no vote poll review findings
QuantumExplorer 38e9563
fix(platform): apply the second yes/no vote poll review round
QuantumExplorer 217cd14
fix(platform): apply the third yes/no vote poll review round
QuantumExplorer 6ffb1e7
fix(platform): apply the fourth yes/no vote poll review round
QuantumExplorer af1ae5b
Merge v5.1-dev into the yes/no vote poll branch
QuantumExplorer e74343b
fix(platform): version the yes/no poll rules and refuse resource vote…
QuantumExplorer 245f526
fix(platform): refuse yes/no polls in resource votes read from JSON a…
QuantumExplorer 258d540
fix(platform): mark every yes/no poll method not active before protoc…
QuantumExplorer 4a7f57f
fix(platform): read the yes/no vote weights from SystemLimits and bui…
QuantumExplorer 00eb496
test(drive-abci): move the nullifier batch guard's latest-version roo…
QuantumExplorer 88df31e
refactor(platform): name the yes/no vote poll activation version
QuantumExplorer b634524
Merge v5.1-dev into the yes/no vote poll branch
QuantumExplorer b30a5c0
fix(drive): refuse the yes/no poll state query before protocol versio…
QuantumExplorer 0222808
fix(sdk): answer no current DPNS contests for a zero limit
QuantumExplorer 1dace00
refactor(platform)!: select the yes/no vote poll id through the platf…
QuantumExplorer fe6482b
Merge v5.1-dev into the yes/no vote poll branch
QuantumExplorer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...-dpp/src/errors/consensus/state/voting/yes_no_vote_poll_not_available_for_voting_error.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| use crate::consensus::state::state_error::StateError; | ||
| use crate::consensus::ConsensusError; | ||
| use crate::errors::ProtocolError; | ||
| use crate::voting::vote_info_storage::yes_no_vote_poll_stored_info::YesNoVotePollStatus; | ||
| use crate::voting::vote_polls::yes_no_vote_poll::YesNoVotePoll; | ||
| use bincode::{Decode, DecodeUntrusted, Encode}; | ||
| use platform_serialization_derive::{ | ||
| PlatformDeserializeTrusted, PlatformDeserializeUntrusted, PlatformSerialize, | ||
| }; | ||
| use thiserror::Error; | ||
|
|
||
| /// A vote on a yes/no poll that exists but is no longer taking votes (protocol version 15). | ||
| #[derive( | ||
| Error, | ||
| Debug, | ||
| Clone, | ||
| PartialEq, | ||
| Encode, | ||
| Decode, | ||
| PlatformSerialize, | ||
| PlatformDeserializeTrusted, | ||
| PlatformDeserializeUntrusted, | ||
| DecodeUntrusted, | ||
| )] | ||
| #[error("yes/no vote poll {vote_poll} is not available for voting: {status}")] | ||
| #[platform_serialize(unversioned)] | ||
| pub struct YesNoVotePollNotAvailableForVotingError { | ||
| /* | ||
| DO NOT CHANGE ORDER OF FIELDS WITHOUT INTRODUCING OF NEW VERSION | ||
| */ | ||
| vote_poll: YesNoVotePoll, | ||
| status: YesNoVotePollStatus, | ||
| } | ||
|
|
||
| impl YesNoVotePollNotAvailableForVotingError { | ||
| pub fn new(vote_poll: YesNoVotePoll, status: YesNoVotePollStatus) -> Self { | ||
| Self { vote_poll, status } | ||
| } | ||
|
|
||
| pub fn vote_poll(&self) -> &YesNoVotePoll { | ||
| &self.vote_poll | ||
| } | ||
|
|
||
| pub fn status(&self) -> &YesNoVotePollStatus { | ||
| &self.status | ||
| } | ||
| } | ||
|
|
||
| impl From<YesNoVotePollNotAvailableForVotingError> for ConsensusError { | ||
| fn from(err: YesNoVotePollNotAvailableForVotingError) -> Self { | ||
| Self::StateError(StateError::YesNoVotePollNotAvailableForVotingError(err)) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.