radicle/cob/identity: Add SiblingAccepted error variant
Add an `ApplyError` for variant, `SiblingAccepted`, to use to enforce the new invariant: delegates must not accept active, sibling revisions.
This commit is contained in:
parent
654218e6a5
commit
7daeb3135b
|
|
@ -501,6 +501,7 @@ fn on_apply_err(e: &identity::ApplyError, profile: &Profile) -> anyhow::Error {
|
|||
| e @ radicle::cob::identity::ApplyError::MissingParent
|
||||
| e @ radicle::cob::identity::ApplyError::DuplicateVerdict
|
||||
| e @ radicle::cob::identity::ApplyError::UnexpectedState
|
||||
| e @ radicle::cob::identity::ApplyError::SiblingAccepted
|
||||
| e @ radicle::cob::identity::ApplyError::DocUnchanged
|
||||
| e @ radicle::cob::identity::ApplyError::Git(_)
|
||||
| e @ radicle::cob::identity::ApplyError::Doc(_)
|
||||
|
|
|
|||
|
|
@ -122,6 +122,8 @@ pub enum ApplyError {
|
|||
DuplicateVerdict,
|
||||
#[error("revision is in an unexpected state")]
|
||||
UnexpectedState,
|
||||
#[error("delegate already accepted a sibling revision '{revision}'")]
|
||||
SiblingAccepted { revision: RevisionId },
|
||||
#[error("document does not contain any changes to current identity")]
|
||||
DocUnchanged,
|
||||
#[error("git: {0}")]
|
||||
|
|
|
|||
Loading…
Reference in New Issue