casper-network / casper-network/casper-node
Add Exhaustive Test for Enum Mapping in BinaryPort
- Dominant language
- Rust
- Stars
- 399
- Forks
- 224
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 2
Description
**Objective:** Add exhaustive unit test for enum mapping `TransactionError` between the `casper-node` and Binary Port.
**Description:** Add a unit test that enforces exhaustive mapping between the `TransactionError` enum in the node and the equivalent enum in the binary port, so that future changes to the node’s transaction error handling will trigger test failures if mappings are not updated.
**Additional context:** This test will act as a guardrail against silent failures that may arise when a new error variant is added without updating the binary port's equivalent. This has occurred multiple times and needs proactive prevention.
**Acceptance Criteria:**
- Implement a unit test that fails if new variants in the `TransactionError` enum are not reflected in the binary port.
- Test should validate both completeness and correctness of the mapping.
- Document the requirement to maintain parity between the enums when changes are made.
- Review existing enum variants to ensure the mapping is already complete as of now.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.