generated from StabilityNexus/Template-Repo
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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
unittestorpytest - 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
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request