Skip to content

[8] Comprehensive Error Variant & Panic Reason Demangler #815

Description

@ayomideadeniran

Description

When Soroban contracts panic or return custom error types (e.g. Error(Contract, #1)), Crucible should automatically decode the error variant back to the enum name and source line.

Location

contracts/crucible/src/env.rs:

contracts/crucible/src/env.rs
// Location: contracts/crucible/src/env.rs // Production requirement: Comprehensive Error Variant & Panic Reason Demangler

Impact

Raw numerical error codes force developers to cross-reference contract source files manually.

Required Fix

  • Implement error mapping registry parsing contract ContractError definitions.
  • Enhance assert_reverts! macro to assert against custom error enums with clear formatted assertion diffs.
  • Write tests validating enum demangling across multi-contract error bubbling.

Reference

Identified during Crucible Core Testing Framework production readiness audit.


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions