Feature and its Use Cases
📄 Description
MiniChain plans to implement transaction signing and verification using PyNaCl.
Once the core transaction logic is available, it would be beneficial to add a minimal unit test suite to ensure correctness and prevent subtle cryptographic bugs.
Since MiniChain aims to be a clean and educational blockchain implementation, including simple tests would improve reliability without adding unnecessary complexity.
Proposed Test Cases
-
Valid Transaction
- A properly signed transaction should verify successfully.
-
Modified Transaction Data
- Changing transaction fields (e.g., amount) after signing should cause verification to fail.
-
Invalid Public Key
- Using an incorrect public key should fail verification.
-
Replay Protection
- Reusing a transaction with the same nonce should be rejected by state validation logic.
Suggested Approach
- Use Python’s built-in
unittest or pytest
- Add a
tests/ directory
- Keep test coverage minimal but focused on correctness
Why This Matters
- Ensures deterministic and correct signature verification
- Prevents subtle security issues
- Encourages test-driven development
- Keeps the project aligned with its educational goal
Additional Context
No response
Code of Conduct
Feature and its Use Cases
📄 Description
MiniChain plans to implement transaction signing and verification using PyNaCl.
Once the core transaction logic is available, it would be beneficial to add a minimal unit test suite to ensure correctness and prevent subtle cryptographic bugs.
Since MiniChain aims to be a clean and educational blockchain implementation, including simple tests would improve reliability without adding unnecessary complexity.
Proposed Test Cases
Valid Transaction
Modified Transaction Data
Invalid Public Key
Replay Protection
Suggested Approach
unittestorpytesttests/directoryWhy This Matters
Additional Context
No response
Code of Conduct