mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
* Problem: `ValidatorElection` and `MigrationElection` need to inherit from a common `Election` class. Solution: Factored the common logic out of `ValidatorElection` and moved it to `Election` parent class. * Problem: No need to store different types of elections in their own tables Solution: Remove `DB_TABLE` property from `Election` class. Solution: Created the `elections` table with secondary_index `election_id`. * Problem: `UpsertValidatorVote` can be generalized to just be `Vote` Solution: Renamed, refactored and moved the `Vote` class to tie in with the more general `Election` base class. * Problem: `election_id` is not unique if two elections have the same properties. Solution: Added a random `uuid4` seed to enforce uniqueness.
BigchainDB Server Unit Tests
Most of the tests in the tests/ folder are unit tests. For info about how to write and run tests, see the docs about contributing to BigchainDB, especially:
- Write Code - Remember to Write Tests
- Notes on Running a Local Dev Node with Docker Compose, especially
make test - Notes on Running a Local Dev Node as Processes (and Running All Tests)
Note: There are acceptance tests in the acceptance/ folder (at the same level in the hierarchy as the tests/ folder).