fix(dpp): decoding invalid consensus error variants#2510
Conversation
WalkthroughThis pull request removes conditional compilation for JSON schema and state transition validations across multiple modules. Previously optional error variants, modules, and associated imports are now always included. In addition, new conversion implementations and a builder have been added to handle JSON schema validation errors when the feature is enabled. The modifications simplify the code by eliminating feature flags in error-handling and module declarations. Changes
Sequence Diagram(s)sequenceDiagram
participant VE as ValidationError
participant DB as DataBuilder
participant JE as JsonSchemaError
participant CE as ConsensusError
VE->>DB: Pass error details
DB->>JE: Build structured error data
VE->>JE: Convert via From implementation
JE->>CE: Wrap error into ConsensusError
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (15)
🔇 Additional comments (6)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Issue being fixed or feature implemented
Some of consensus error enum variants are defined using features. Since Drive and SDK use different features, SDK is not able to decode a consensus error due to different enum structure.
What was done?
How Has This Been Tested?
None
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit