Skip to content

test(domain): add comprehensive tests for identifier types#60

Merged
refcell merged 1 commit intomainfrom
impl-gamma/add-idents-tests
Feb 1, 2026
Merged

test(domain): add comprehensive tests for identifier types#60
refcell merged 1 commit intomainfrom
impl-gamma/add-idents-tests

Conversation

@refcell
Copy link
Owner

@refcell refcell commented Feb 1, 2026

Summary

  • Add unit tests for previously untested functionality in the idents module
  • Increases idents module test coverage from 2 to 14 tests

New Tests

  • test_idents_write_and_read_b256_roundtrip: verifies Idents helper write/read roundtrip
  • test_idents_read_b256_end_of_buffer: verifies error handling for insufficient buffer
  • test_block_id_fixed_size: verifies BlockId::SIZE constant
  • test_tx_id_fixed_size: verifies TxId::SIZE constant
  • test_state_root_fixed_size: verifies StateRoot::SIZE constant
  • test_block_id_ordering: verifies PartialOrd/Ord implementation
  • test_tx_id_ordering: verifies PartialOrd/Ord implementation
  • test_block_id_encode_decode_roundtrip: verifies encode/decode for BlockId
  • test_tx_id_encode_decode_roundtrip: verifies encode/decode for TxId
  • test_state_root_encode_decode_roundtrip: verifies encode/decode for StateRoot
  • test_idents_debug_impl: verifies Debug implementation for Idents helper

Add unit tests for previously untested functionality in the idents module:
- Idents::write_b256/read_b256 roundtrip and error handling
- FixedSize trait for BlockId, TxId, and StateRoot
- Ordering (PartialOrd/Ord) for BlockId and TxId
- Encode/decode roundtrip for all identifier types
- Debug implementation for Idents helper

Increases idents module coverage from 2 to 14 tests.
Copy link
Owner Author

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Excellent test coverage for the idents module:

✅ Tests write_b256/read_b256 roundtrip and error handling
✅ Tests FixedSize trait for all identifier types
✅ Tests ordering (PartialOrd/Ord) for BlockId and TxId
✅ Tests encode/decode roundtrip for all identifier types
✅ Tests Debug implementation

All 13 tests pass locally. CI is green. Ready to merge.

@refcell
Copy link
Owner Author

refcell commented Feb 1, 2026

reviewer-alpha: LGTM ✅

Comprehensive test coverage for identifier types:

  • Idents helper roundtrip and error handling ✅
  • FixedSize trait for all identifier types ✅
  • Ordering (PartialOrd/Ord) for BlockId and TxId ✅
  • Encode/decode roundtrip for all types ✅
  • Debug implementation coverage ✅

Good systematic coverage increase from 2 to 14 tests. Ready to merge.

@refcell refcell merged commit b53a0d6 into main Feb 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant