chainflip-io / chainflip-backend

The Chainflip backend repo, including the Chainflip Node and CFE.
50 stars 14 forks source link

feat: elections pallet tests #5186

Closed dandanlen closed 2 months ago

dandanlen commented 2 months ago

Pull Request

This includes a mock for the ElectoralSystem trait, and some initial tests of the consensus transitions when votes are added / ignored / deleted.

It's still incomplete - the next step would be to implement a mock of the VoteStorage trait and then generate_vote_properties.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 84.77801% with 72 lines in your changes missing coverage. Please review.

Project coverage is 70%. Comparing base (9ab4732) to head (17deec2). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...pallets/cf-elections/src/electoral_systems/mock.rs 61% 45 Missing and 1 partial :warning:
...ts/cf-elections/src/electoral_systems/composite.rs 0% 8 Missing :warning:
...hain/test-utilities/src/rich_test_externalities.rs 92% 6 Missing :warning:
...chain/pallets/cf-elections/src/electoral_system.rs 0% 5 Missing :warning:
state-chain/pallets/cf-elections/src/lib.rs 73% 3 Missing and 1 partial :warning:
state-chain/pallets/cf-elections/src/tests.rs 98% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5186 +/- ## ====================================== - Coverage 70% 70% -0% ====================================== Files 483 484 +1 Lines 86398 86579 +181 Branches 86398 86579 +181 ====================================== + Hits 60620 60654 +34 - Misses 22494 22643 +149 + Partials 3284 3282 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.