mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
dispute-coordinator: disabling in participation (#2637)
Closes #2225. - [x] tests - [x] fix todos - [x] fix duplicates - [x] make the check part of `potential_spam` - [x] fix a bug with votes insertion - [x] guide changes - [x] docs --------- Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
This commit is contained in:
@@ -1340,12 +1340,8 @@ impl DisputeStatement {
|
||||
|
||||
/// Statement is backing statement.
|
||||
pub fn is_backing(&self) -> bool {
|
||||
match *self {
|
||||
Self::Valid(ValidDisputeStatementKind::BackingSeconded(_)) |
|
||||
Self::Valid(ValidDisputeStatementKind::BackingValid(_)) => true,
|
||||
Self::Valid(ValidDisputeStatementKind::Explicit) |
|
||||
Self::Valid(ValidDisputeStatementKind::ApprovalChecking) |
|
||||
Self::Valid(ValidDisputeStatementKind::ApprovalCheckingMultipleCandidates(_)) |
|
||||
match self {
|
||||
Self::Valid(s) => s.is_backing(),
|
||||
Self::Invalid(_) => false,
|
||||
}
|
||||
}
|
||||
@@ -1374,6 +1370,19 @@ pub enum ValidDisputeStatementKind {
|
||||
ApprovalCheckingMultipleCandidates(Vec<CandidateHash>),
|
||||
}
|
||||
|
||||
impl ValidDisputeStatementKind {
|
||||
/// Whether the statement is from the backing phase.
|
||||
pub fn is_backing(&self) -> bool {
|
||||
match self {
|
||||
ValidDisputeStatementKind::BackingSeconded(_) |
|
||||
ValidDisputeStatementKind::BackingValid(_) => true,
|
||||
ValidDisputeStatementKind::Explicit |
|
||||
ValidDisputeStatementKind::ApprovalChecking |
|
||||
ValidDisputeStatementKind::ApprovalCheckingMultipleCandidates(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Different kinds of statements of invalidity on a candidate.
|
||||
#[derive(Encode, Decode, Copy, Clone, PartialEq, RuntimeDebug, TypeInfo)]
|
||||
pub enum InvalidDisputeStatementKind {
|
||||
|
||||
Reference in New Issue
Block a user