Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: unit tests for wallet/swapcoin.rs #96

Merged
merged 12 commits into from
Feb 29, 2024
Merged

test: unit tests for wallet/swapcoin.rs #96

merged 12 commits into from
Feb 29, 2024

Conversation

wthrajat
Copy link

@wthrajat wthrajat commented Feb 18, 2024

Aims to fix #81.
Added unit tests for various methods like:

fn sign_transaction_input()
fn sign_hashlocked_transaction_input()
fn create_hashlock_spend_without_preimage()
fn apply_privkey_watchonly_swapcoin()
fn apply_privkey_incoming_swapcoin()
fn apply_privkey_outgoing_swapcoin()

Keeping our codecov in mind, various fail/error cases have also been covered to get the coverage higher. Also some tests are implemented for all three structs like IncomingSwapcoin, OutgoingSwapcoin, WatchonlySwapcoin to get more codecov coverage.

PS: After merging, we will go from 65% to 85% in this swapcoin.rs. Also these tests indirectly increased the coverage in several other files as well. We'll analyze the overall codecov once this is merged.

Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
@wthrajat wthrajat requested a review from a team February 18, 2024 08:06
Copy link

codecov bot commented Feb 18, 2024

Codecov Report

Attention: Patch coverage is 90.68627% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 73.58%. Comparing base (a08292d) to head (451353d).

Files Patch % Lines
src/wallet/swapcoin.rs 90.68% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
+ Coverage   71.56%   73.58%   +2.02%     
==========================================
  Files          28       28              
  Lines        5911     6115     +204     
==========================================
+ Hits         4230     4500     +270     
+ Misses       1681     1615      -66     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wthrajat wthrajat self-assigned this Feb 18, 2024
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
@rajarshimaitra rajarshimaitra added the tests Testing related improvements label Feb 18, 2024
@rajarshimaitra rajarshimaitra added this to the v0.1.0 milestone Feb 18, 2024
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
Copy link

@rajarshimaitra rajarshimaitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK. Please rebase after merge of #100 to pickup the clippy fixes.

Signed-off-by: wthrajat <rajatkhanduri290102@gmail.com>
@wthrajat
Copy link
Author

Rebased after the merge of #100!

Copy link

@rajarshimaitra rajarshimaitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 451353d

@rajarshimaitra rajarshimaitra merged commit db0a89f into citadel-tech:master Feb 29, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Testing related improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: Unit test for wallet/swapcoin.rs
2 participants