1use openmls_traits::types::Ciphersuite;
6use thiserror::Error;
7
8#[cfg(feature = "extensions-draft")]
9use super::public_group::errors::ApplyAppDataUpdateError;
10
11pub use super::mls_group::errors::*;
12use super::public_group::errors::CreationFromExternalError;
13use crate::{
14 ciphersuite::signable::SignatureError,
15 error::LibraryError,
16 extensions::errors::{ExtensionError, InvalidExtensionError},
17 framing::errors::MessageDecryptionError,
18 group::commit_builder::external_commits::ExternalCommitBuilderError,
19 key_packages::errors::{KeyPackageExtensionSupportError, KeyPackageVerifyError},
20 messages::{group_info::GroupInfoError, GroupSecretsError},
21 prelude::ExtensionType,
22 schedule::{
23 errors::{KeyScheduleError, PskError},
24 PreSharedKeyId,
25 },
26 treesync::errors::*,
27};
28
29#[cfg(doc)]
30use crate::{group::GroupId, treesync::LeafNodeParameters};
31
32#[derive(Error, Debug, PartialEq, Clone)]
34pub enum WelcomeError<StorageError> {
35 #[error(transparent)]
37 GroupSecrets(#[from] GroupSecretsError),
38 #[error("Private part of `init_key` not found in key store.")]
40 PrivateInitKeyNotFound,
41 #[error(transparent)]
43 LibraryError(#[from] LibraryError),
44 #[error("Ciphersuites in Welcome and key package bundle don't match.")]
46 CiphersuiteMismatch,
47 #[error(transparent)]
49 GroupInfo(#[from] GroupInfoError),
50 #[error("No joiner secret found in the Welcome message.")]
52 JoinerSecretNotFound,
53 #[error("No ratchet tree available to build initial tree after receiving a Welcome message.")]
55 MissingRatchetTree,
56 #[error("The computed confirmation tag does not match the expected one.")]
58 ConfirmationTagMismatch,
59 #[error("The signature on the GroupInfo is not valid.")]
61 InvalidGroupInfoSignature,
62 #[error("We don't support the version of the group we are trying to join.")]
64 UnsupportedMlsVersion,
65 #[error("We don't support all capabilities of the group.")]
67 UnsupportedCapability,
68 #[error("Ciphersuite {0:?} of the group we are trying to join is not supported by the crypto provider.")]
70 UnsupportedCiphersuite(Ciphersuite),
71 #[error("Sender not found in tree.")]
73 UnknownSender,
74 #[error("Not a Welcome message.")]
76 NotAWelcomeMessage,
77 #[error("Malformed Welcome message.")]
79 MalformedWelcomeMessage,
80 #[error("Could not decrypt the Welcome message.")]
82 UnableToDecrypt,
83 #[error("Unsupported extensions found in the GroupContext or KeyPackage of another member.")]
85 UnsupportedExtensions,
86 #[error(transparent)]
88 Psk(#[from] PskError),
89 #[error("No matching encryption key was found in the key store.")]
91 NoMatchingEncryptionKey,
92 #[error("No matching key package was found in the key store.")]
94 NoMatchingKeyPackage,
95 #[error(transparent)]
97 PublicTreeError(#[from] PublicTreeError),
98 #[error(transparent)]
101 PublicGroupError(#[from] CreationFromExternalError<StorageError>),
102 #[error(transparent)]
104 LeafNodeValidation(#[from] LeafNodeValidationError),
105 #[error("An error occurred when querying storage")]
107 StorageError(StorageError),
108 #[error("A group with this [`GroupId`] already exists.")]
110 GroupAlreadyExists,
111 #[cfg(feature = "virtual-clients-draft")]
114 #[error(transparent)]
115 VirtualClientsError(#[from] crate::components::vc_derivation_info::VirtualClientsError),
116 #[cfg(feature = "virtual-clients-draft")]
119 #[error(transparent)]
120 RegisterVcDerivationEpoch(#[from] crate::group::RegisterVcDerivationEpochError<StorageError>),
121 #[error(transparent)]
123 KeySchedule(#[from] KeyScheduleError),
124 #[error("The subgroup's protocol version or ciphersuite does not match the parent group.")]
127 SubgroupParameterMismatch,
128 #[error("The subgroup is not at epoch 1.")]
131 SubgroupEpochInvalid,
132 #[error("A member of the subgroup does not match any member of the parent group.")]
135 SubgroupLeafMismatch,
136 #[error("The subgroup's branch PSK does not reference the provided parent group/epoch.")]
139 SubgroupParentMismatch,
140}
141
142#[derive(Error, Debug, PartialEq, Clone)]
144pub enum ExternalCommitError<StorageError> {
145 #[error(transparent)]
147 LibraryError(#[from] LibraryError),
148 #[error("No ratchet tree available to build initial tree.")]
150 MissingRatchetTree,
151 #[error("No external_pub extension available to join group by external commit.")]
153 MissingExternalPub,
154 #[error("Ciphersuite {0:?} of the group we are trying to join is not supported by the crypto provider.")]
156 UnsupportedCiphersuite(Ciphersuite),
157 #[error("Sender not found in tree.")]
159 UnknownSender,
160 #[error("The signature over the given group info is invalid.")]
162 InvalidGroupInfoSignature,
163 #[error("Error creating external commit.")]
165 CommitError(#[from] CreateCommitError),
166 #[error(transparent)]
169 PublicGroupError(#[from] CreationFromExternalError<StorageError>),
170 #[error("Credential is missing from external commit.")]
172 MissingCredential,
173 #[error("An error occurred when writing group to storage.")]
175 StorageError(StorageError),
176}
177
178impl<StorageError> From<ExternalCommitBuilderError<StorageError>>
179 for ExternalCommitError<StorageError>
180{
181 fn from(error: ExternalCommitBuilderError<StorageError>) -> Self {
182 match error {
183 ExternalCommitBuilderError::LibraryError(library_error) => {
184 ExternalCommitError::LibraryError(library_error)
185 }
186 ExternalCommitBuilderError::MissingRatchetTree => {
187 ExternalCommitError::MissingRatchetTree
188 }
189 ExternalCommitBuilderError::MissingExternalPub => {
190 ExternalCommitError::MissingExternalPub
191 }
192 ExternalCommitBuilderError::UnsupportedCiphersuite(ciphersuite) => {
193 ExternalCommitError::UnsupportedCiphersuite(ciphersuite)
194 }
195 ExternalCommitBuilderError::PublicGroupError(creation_from_external_error) => {
196 ExternalCommitError::PublicGroupError(creation_from_external_error)
197 }
198 ExternalCommitBuilderError::StorageError(error) => {
199 ExternalCommitError::StorageError(error)
200 }
201 ExternalCommitBuilderError::InvalidProposal(e) => {
204 log::error!("Error validating proposal in external commit: {e}");
205 ExternalCommitError::LibraryError(LibraryError::custom(
206 "Error creating external commit",
207 ))
208 }
209 }
210 }
211}
212
213#[cfg(feature = "virtual-clients-draft")]
219#[derive(Error, Debug)]
220pub enum VcExternalCommitJoinError<StorageError> {
221 #[error(transparent)]
223 LibraryError(#[from] LibraryError),
224 #[error("No ratchet tree available to build the prior-epoch public group.")]
226 MissingRatchetTree,
227 #[error(transparent)]
229 PublicGroupError(#[from] CreationFromExternalError<StorageError>),
230 #[error(transparent)]
232 ProcessMessageError(#[from] ProcessMessageError<StorageError>),
233 #[error(transparent)]
235 StageCommitError(#[from] StageCommitError),
236 #[error(transparent)]
238 MergeCommitError(#[from] MergeCommitError<StorageError>),
239 #[error("The message is not an external commit.")]
242 NotAnExternalCommit,
243 #[error("The external commit carries no virtual-clients derivation info.")]
246 MissingDerivationInfo,
247 #[error("The external commit references a different derivation epoch.")]
250 EpochIdMismatch,
251 #[error(transparent)]
253 VirtualClientsError(#[from] crate::components::vc_derivation_info::VirtualClientsError),
254 #[error("An error occurred when writing the group to storage.")]
256 StorageError(StorageError),
257}
258
259#[cfg(feature = "virtual-clients-draft")]
265#[derive(Error, Debug)]
266pub enum VcGroupCreationJoinError<StorageError> {
267 #[error(transparent)]
269 LibraryError(#[from] LibraryError),
270 #[error("No ratchet tree available to build the created group's public tree.")]
272 MissingRatchetTree,
273 #[error(transparent)]
276 PublicGroupError(#[from] CreationFromExternalError<StorageError>),
277 #[error("The ratchet tree does not consist of exactly the creator's leaf.")]
279 NotASingleLeafTree,
280 #[error("The creator leaf carries no virtual-clients derivation info.")]
282 MissingDerivationInfo,
283 #[error("The creator leaf references a different derivation epoch.")]
286 EpochIdMismatch,
287 #[error("The creator leaf is not key_package-sourced.")]
290 CreatorLeafNotKeyPackageSourced,
291 #[error("The derived leaf key material does not match the creator leaf.")]
294 LeafKeyMismatch,
295 #[error("The GroupInfo could not be verified against the reconstructed epoch state.")]
298 ConfirmationTagMismatch,
299 #[error(transparent)]
301 VirtualClientsError(#[from] crate::components::vc_derivation_info::VirtualClientsError),
302 #[error("An error occurred when writing the group to storage.")]
304 StorageError(StorageError),
305}
306
307impl<StorageError> From<ExternalCommitBuilderFinalizeError<StorageError>>
308 for ExternalCommitError<StorageError>
309{
310 fn from(error: ExternalCommitBuilderFinalizeError<StorageError>) -> Self {
311 match error {
312 ExternalCommitBuilderFinalizeError::LibraryError(library_error) => {
313 ExternalCommitError::LibraryError(library_error)
314 }
315 ExternalCommitBuilderFinalizeError::StorageError(error) => {
316 ExternalCommitError::StorageError(error)
317 }
318 ExternalCommitBuilderFinalizeError::MergeCommitError(e) => {
319 log::error!("Error merging external commit: {e}");
320 ExternalCommitError::LibraryError(LibraryError::custom(
323 "Error merging external commit",
324 ))
325 }
326 }
327 }
328}
329
330#[derive(Error, Debug, PartialEq, Clone)]
332pub enum StageCommitError {
333 #[cfg(feature = "virtual-clients-draft")]
335 #[error(transparent)]
336 VirtualClientsError(#[from] crate::components::vc_derivation_info::VirtualClientsError),
337 #[cfg(feature = "virtual-clients-draft")]
342 #[error("The commit's virtual-clients Safe AAD item did not parse: {0}")]
343 MalformedVcCommitData(String),
344 #[error(transparent)]
346 LibraryError(#[from] LibraryError),
347 #[error("The epoch of the group context and PublicMessage didn't match.")]
349 EpochMismatch,
350 #[error("The Commit was created by this client but does not match the pending commit.")]
352 OwnCommitMismatch,
353 #[error("stage_commit was called with an PublicMessage that is not a Commit.")]
355 WrongPlaintextContentType,
356 #[error("Unable to verify the leaf node signature.")]
358 PathLeafNodeVerificationFailure,
359 #[error("Unable to determine commit path.")]
361 RequiredPathNotFound,
362 #[error("The confirmation Tag is missing.")]
364 ConfirmationTagMissing,
365 #[error("The confirmation tag is invalid.")]
367 ConfirmationTagMismatch,
368 #[error("The committer can't remove themselves.")]
370 AttemptedSelfRemoval,
371 #[error("The proposal queue is missing a proposal for the commit.")]
373 MissingProposal,
374 #[error("Missing own key to apply proposal.")]
376 OwnKeyNotFound,
377 #[error("External Committer used the wrong index.")]
379 InconsistentSenderIndex,
380 #[error("The sender is of type external, which is not valid.")]
382 SenderTypeExternal,
383 #[error("The sender is of type NewMemberProposal, which is not valid.")]
385 SenderTypeNewMemberProposal,
386 #[error("Too many new members: the tree is full.")]
388 TooManyNewMembers,
389 #[error(transparent)]
391 ProposalValidationError(#[from] ProposalValidationError),
392 #[error(transparent)]
394 PskError(#[from] PskError),
395 #[error(transparent)]
397 ExternalCommitValidation(#[from] ExternalCommitValidationError),
398 #[error(transparent)]
400 UpdatePathError(#[from] ApplyUpdatePathError),
401 #[error("Missing decryption key.")]
403 MissingDecryptionKey,
404 #[error(transparent)]
406 VerifiedUpdatePathError(#[from] UpdatePathError),
407 #[error(transparent)]
409 GroupContextExtensionsProposalValidationError(
410 #[from] GroupContextExtensionsProposalValidationError,
411 ),
412 #[cfg(feature = "extensions-draft")]
413 #[error(transparent)]
415 AppDataUpdateValidationError(#[from] AppDataUpdateValidationError),
416 #[error(transparent)]
418 LeafNodeValidation(#[from] LeafNodeValidationError),
419 #[cfg(feature = "extensions-draft")]
421 #[error(transparent)]
422 ApplyAppDataUpdateError(#[from] ApplyAppDataUpdateError),
423 #[error("Duplicate PSK proposal with PSK ID {0:?}.")]
425 DuplicatePskId(PreSharedKeyId),
426}
427
428#[derive(Error, Debug, PartialEq, Clone)]
430pub enum CreateCommitError {
431 #[error(transparent)]
433 LibraryError(#[from] LibraryError),
434 #[cfg(feature = "virtual-clients-draft")]
436 #[error(transparent)]
437 VirtualClientsError(#[from] crate::components::vc_derivation_info::VirtualClientsError),
438 #[cfg(feature = "virtual-clients-draft")]
441 #[error(transparent)]
442 VcCommitData(#[from] crate::components::vc_commit_data::VcCommitDataError),
443 #[cfg(feature = "virtual-clients-draft")]
446 #[error("A new derivation epoch requires the group to use Safe AAD framing.")]
447 NewDerivationEpochWithoutSafeAad,
448 #[cfg(feature = "virtual-clients-draft")]
452 #[error("A new derivation epoch can only be requested in an emulation group.")]
453 NewDerivationEpochOutsideEmulationGroup,
454 #[error("Missing own key to apply proposal.")]
456 OwnKeyNotFound,
457 #[error("The Commit tried to remove self from the group. This is not possible.")]
459 CannotRemoveSelf,
460 #[error("The proposal queue is missing a proposal for the commit.")]
462 MissingProposal,
463 #[error("A proposal has the wrong sender type.")]
465 WrongProposalSenderType,
466 #[error(transparent)]
468 PskError(#[from] PskError),
469 #[error(transparent)]
471 ProposalValidationError(#[from] ProposalValidationError),
472 #[error(transparent)]
474 SignatureError(#[from] SignatureError),
475 #[error("Credential is missing from external commit.")]
477 MissingCredential,
478 #[error(transparent)]
480 PublicTreeError(#[from] PublicTreeError),
481 #[error(transparent)]
483 InvalidExtensionError(#[from] InvalidExtensionError),
484 #[cfg(feature = "extensions-draft")]
485 #[error(transparent)]
487 AppDataUpdateValidationError(#[from] AppDataUpdateValidationError),
488 #[error(transparent)]
490 GroupContextExtensionsProposalValidationError(
491 #[from] GroupContextExtensionsProposalValidationError,
492 ),
493 #[error(transparent)]
495 TreeSyncAddLeaf(#[from] TreeSyncAddLeaf),
496 #[error("Invalid LeafNodeParameters. CredentialWithKey can't be set with new signer.")]
498 InvalidLeafNodeParameters,
499 #[error("The new signer's signature scheme does not match the group's ciphersuite.")]
501 InvalidSignerCiphersuite,
502 #[error("A new signer cannot be used with an external commit. The credential and signer are the ones passed to the external commit builder.")]
504 ExternalCommitWithNewSigner,
505 #[error("The credential in the LeafNodeParameters differs from the one passed to the external commit builder.")]
507 ExternalCommitCredentialMismatch,
508 #[error("Invalid external commit.")]
510 InvalidExternalCommit(#[from] ExternalCommitValidationError),
511 #[cfg(feature = "extensions-draft")]
513 #[error(transparent)]
514 ApplyAppDataUpdateError(#[from] ApplyAppDataUpdateError),
515 #[error(transparent)]
517 LeafNodeValidation(#[from] LeafNodeValidationError),
518}
519
520#[derive(Error, Debug, PartialEq, Clone)]
522pub enum CommitBuilderStageError<StorageError> {
523 #[error(transparent)]
525 LibraryError(#[from] LibraryError),
526 #[error("Error interacting with storage.")]
528 KeyStoreError(StorageError),
529}
530
531#[derive(Error, Debug, PartialEq, Clone)]
533pub enum ExternalCommitBuilderFinalizeError<StorageError> {
534 #[error(transparent)]
536 LibraryError(#[from] LibraryError),
537 #[error("Error interacting with storage.")]
539 StorageError(StorageError),
540 #[error("Error merging external commit.")]
542 MergeCommitError(#[from] MergePendingCommitError<StorageError>),
543}
544
545#[derive(Error, Debug, PartialEq, Clone)]
547pub enum ValidationError {
548 #[error(transparent)]
550 LibraryError(#[from] LibraryError),
551 #[error("Message group ID differs from the group's group ID.")]
553 WrongGroupId,
554 #[error("Message epoch differs from the group's epoch.")]
556 WrongEpoch,
557 #[error("The PublicMessage is not a Commit despite the sender begin of type NewMemberCommit.")]
559 NotACommit,
560 #[error("The PublicMessage is not an external Add proposal despite the sender begin of type NewMemberProposal.")]
562 NotAnExternalAddProposal,
563 #[error("The Commit doesn't have a path despite the sender being of type NewMemberCommit.")]
565 NoPath,
566 #[error("The PublicMessage contains an application message but was not encrypted.")]
568 UnencryptedApplicationMessage,
569 #[error("Sender is not part of the group.")]
571 UnknownMember,
572 #[error("Membership tag is missing.")]
574 MissingMembershipTag,
575 #[error("Membership tag is invalid.")]
577 InvalidMembershipTag,
578 #[error("The confirmation tag is missing.")]
580 MissingConfirmationTag,
581 #[error("Wrong wire format.")]
583 WrongWireFormat,
584 #[error("Verifying the signature failed.")]
586 InvalidSignature,
587 #[error("An application message was sent from an external sender.")]
589 NonMemberApplicationMessage,
590 #[error(transparent)]
592 UnableToDecrypt(#[from] MessageDecryptionError),
593 #[error("The message is from an epoch too far in the past.")]
595 NoPastEpochData,
596 #[error("The provided external sender is not authorized to send external proposals")]
598 UnauthorizedExternalSender,
599 #[error("The group doesn't contain external senders extension")]
601 NoExternalSendersExtension,
602 #[error(transparent)]
604 KeyPackageVerifyError(#[from] KeyPackageVerifyError),
605 #[error(transparent)]
607 UpdatePathError(#[from] UpdatePathError),
608 #[error("Invalid LeafNode signature.")]
610 InvalidLeafNodeSignature,
611 #[error("Invalid LeafNode source type")]
613 InvalidLeafNodeSourceType,
614 #[error("Invalid sender type")]
616 InvalidSenderType,
617 #[error("The Commit includes update proposals from the committer.")]
619 CommitterIncludedOwnUpdate,
620 #[error(
622 "The ciphersuite in the KeyPackage of the Add proposal does not match the group context."
623 )]
624 InvalidAddProposalCiphersuite,
625 #[error(transparent)]
627 ExternalCommitValidation(#[from] ExternalCommitValidationError),
628 #[error("Invalid extension")]
630 InvalidExtension(#[from] InvalidExtensionError),
631}
632
633#[derive(Error, Debug, PartialEq, Clone)]
635pub enum ProposalValidationError {
636 #[error(transparent)]
638 LibraryError(#[from] LibraryError),
639 #[error("The sender could not be matched to a member of the group.")]
641 UnknownMember,
642 #[error("Duplicate signature key in proposals and group.")]
644 DuplicateSignatureKey,
645 #[error("Duplicate encryption key in proposals and group.")]
647 DuplicateEncryptionKey,
648 #[error("Duplicate init key in proposals.")]
650 DuplicateInitKey,
651 #[error("The HPKE init and encryption keys are the same.")]
653 InitEncryptionKeyCollision,
654 #[error("Duplicate remove proposals for the same member.")]
656 DuplicateMemberRemoval,
657 #[error("The remove proposal referenced a non-existing member.")]
659 UnknownMemberRemoval,
660 #[error("Found an update from a non-member.")]
662 UpdateFromNonMember,
663 #[error("The Commit includes update proposals from the committer.")]
665 CommitterIncludedOwnUpdate,
666 #[error("The capabilities of the add proposal are insufficient for this group.")]
668 InsufficientCapabilities,
669 #[error(
671 "The add proposal's ciphersuite or protocol version do not match the ones in the group context."
672 )]
673 InvalidAddProposalCiphersuiteOrVersion,
674 #[error(transparent)]
676 Psk(#[from] PskError),
677 #[error("The proposal type is not supported by all group members.")]
679 UnsupportedProposalType,
680 #[error(transparent)]
682 LeafNodeValidation(#[from] LeafNodeValidationError),
683 #[error("Found ExternalInit proposal in regular commit")]
685 ExternalInitProposalInRegularCommit,
686}
687
688#[derive(Error, Debug, PartialEq, Clone)]
690pub enum ExternalCommitValidationError {
691 #[error(transparent)]
693 LibraryError(#[from] LibraryError),
694 #[error("No ExternalInit proposal found.")]
696 NoExternalInitProposals,
697 #[error("Multiple ExternalInit proposal found.")]
699 MultipleExternalInitProposals,
700 #[error("Found inline Add or Update proposals.")]
702 InvalidInlineProposals,
703 #[error("Found multiple inline Remove proposals.")]
705 MultipleRemoveProposals,
706 #[error("Remove proposal targets the wrong group member.")]
708 InvalidRemoveProposal,
709 #[error("External Commit has to contain a path.")]
711 NoPath,
712 #[error("Found a referenced proposal in an External Commit.")]
714 ReferencedProposal,
715 #[error("External committer's leaf node does not support all group context extensions.")]
717 UnsupportedGroupContextExtensions,
718}
719
720#[derive(Error, Debug, PartialEq, Clone)]
722pub enum CreateAddProposalError {
723 #[error(transparent)]
725 LibraryError(#[from] LibraryError),
726 #[error(transparent)]
728 LeafNodeValidation(#[from] LeafNodeValidationError),
729}
730
731#[derive(Error, Debug, PartialEq, Clone)]
735pub(crate) enum ProposalQueueError {
736 #[error(transparent)]
738 LibraryError(#[from] LibraryError),
739 #[error("Not all proposals in the Commit were found locally.")]
741 ProposalNotFound,
742 #[error("Update proposal from external sender.")]
744 UpdateFromExternalSender,
745 #[error("SelfRemove proposal from a non-Member.")]
747 SelfRemoveFromNonMember,
748}
749
750#[derive(Error, Debug, PartialEq, Clone)]
753pub(crate) enum FromCommittedProposalsError {
754 #[error(transparent)]
756 LibraryError(#[from] LibraryError),
757 #[error("Not all proposals in the Commit were found locally.")]
759 ProposalNotFound,
760 #[error("The sender of a Commit tried to remove themselves.")]
762 SelfRemoval,
763 #[error("Commit contains two PSK proposals the PSK ID {0:?}.")]
765 DuplicatePskId(PreSharedKeyId),
766}
767
768#[derive(Error, Debug, PartialEq, Clone)]
770pub enum CreateGroupContextExtProposalError<StorageError> {
771 #[error(transparent)]
773 LibraryError(#[from] LibraryError),
774 #[error(transparent)]
776 KeyPackageExtensionSupport(#[from] KeyPackageExtensionSupportError),
777 #[error(transparent)]
779 Extension(#[from] ExtensionError),
780 #[error(transparent)]
782 LeafNodeValidation(#[from] LeafNodeValidationError),
783 #[error(transparent)]
785 MlsGroupStateError(#[from] MlsGroupStateError),
786 #[error(transparent)]
788 CreateCommitError(#[from] CreateCommitError),
789 #[error(transparent)]
791 CommitBuilderStageError(#[from] CommitBuilderStageError<StorageError>),
792 #[error("Error writing updated group data to storage.")]
794 StorageError(StorageError),
795 #[error(transparent)]
797 InvalidExtensionError(#[from] InvalidExtensionError),
798}
799
800#[derive(Error, Debug, PartialEq, Clone)]
802pub enum MergeCommitError<StorageError> {
803 #[error(transparent)]
805 LibraryError(#[from] LibraryError),
806 #[error("Error writing updated group data to storage.")]
808 StorageError(StorageError),
809 #[cfg(feature = "virtual-clients-draft")]
812 #[error(transparent)]
813 RegisterVcDerivationEpoch(#[from] crate::group::RegisterVcDerivationEpochError<StorageError>),
814}
815
816#[cfg(feature = "extensions-draft")]
817#[derive(Error, Debug, PartialEq, Clone)]
819pub enum AppDataUpdateValidationError {
820 #[error("AppDataUpdate proposals occur before GroupContextExtensions proposals.")]
824 IncorrectOrder,
825 #[error("Attempted to update the AppDataDictionary in the GroupContextExtensions proposal directly.")]
829 CannotUpdateDictionaryDirectly,
830 #[error("More than one AppDataUpdate proposal per ComponentId had a Remove operation.")]
834 MoreThanOneRemovePerComponentId,
835 #[error("Proposals for a ComponentId had both Remove and Update operations.")]
839 CombinedRemoveAndUpdateOperations,
840 #[error("Proposals for a ComponentId had a Remove for a nonexistent component.")]
844 CannotRemoveNonexistentComponent,
845}
846
847#[derive(Error, Debug, PartialEq, Clone)]
849pub enum GroupContextExtensionsProposalValidationError {
850 #[error("Commit has more than one GroupContextExtensions proposal.")]
852 TooManyGCEProposals,
853
854 #[error(transparent)]
856 LibraryError(#[from] LibraryError),
857
858 #[error(
860 "The new required capabilties contain extension types that are not supported by all group members."
861 )]
862 ExtensionNotSupportedByAllMembers,
863 #[error("Proposal changes the immutable metadata extension, which is not allowed.")]
865 ChangedImmutableMetadata,
866
867 #[error(
869 "The new required capabilties contain extension types that are not supported by all group members."
870 )]
871 RequiredExtensionNotSupportedByAllMembers,
872
873 #[error(
876 "An extension in the group context extensions is not listed in the required capabilties' extension types."
877 )]
878 ExtensionNotInRequiredCapabilities,
879
880 #[error("Expected valid `Extension` for `GroupContextExtension`, got `{wrong:?}`")]
882 InvalidExtensionTypeError {
883 wrong: ExtensionType,
885 },
886}