Skip to content

test: Add Initial Unit Tests for BiniBFT Proposal and Request Parsing#18

Open
Ayush-AM wants to merge 1 commit into
BiniWorld:binibftfrom
Ayush-AM:binibft
Open

test: Add Initial Unit Tests for BiniBFT Proposal and Request Parsing#18
Ayush-AM wants to merge 1 commit into
BiniWorld:binibftfrom
Ayush-AM:binibft

Conversation

@Ayush-AM

Copy link
Copy Markdown

Description

This PR introduces the initial set of unit tests for the BiniBFT proposal and request parsing logic on the binibft branch, fulfilling the requirements for Issue #16. No production behavior or implementation details have been modified.

Changes Included

  • types_test.go: Added table-driven round-trip tests (serialization and deserialization) for Transaction, BlockData, BlockHeader, and Block. Handled standard and edge cases (e.g., empty fields).
  • verifier_test.go: Implemented table-driven tests for VerifyProposal and RequestsFromProposal to ensure they accurately extract the expected RequestInfo lists from valid block payloads.
  • request_inspector_test.go: Added table-driven tests for RequestID to verify the correct extraction of ClientID and ID from serialized transactions.

Related Issues

Acceptance Criteria Met

  • New tests added and pass locally with go test ./... on binibft.
  • Tests are table-driven covering at least 2 cases per function group.
  • No production behavior changes included (tests-only).
  • Commits are signed off (-s) following standard Hyperledger contribution guidelines.

Signed-off-by: Ayush Mahajan <140263932+Ayush-AM@users.noreply.github.com>
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