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

[VDG] Privacy Progress N/A when balance is zero #12575

Merged
merged 6 commits into from Mar 14, 2024

Conversation

ichthus1604
Copy link
Collaborator

Fixes #9543

image

I tried - as mentioned here but it looks really ugly:

image

@ichthus1604
Copy link
Collaborator Author

@soosr Also, just a suggestion: maybe we can add a cool, marketing heavy tooltip when this appears such as: "Move your BTC into Wasabi and make them fully private now!" or something?

@ichthus1604 ichthus1604 changed the title [VDG] Privacy Progress N/A [VDG] Privacy Progress N/A when balance is zero Feb 28, 2024
Copy link
Collaborator

@yahiheb yahiheb left a comment

Choose a reason for hiding this comment

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

When the balance is zero and you receive some bitcoin you will see 100 % for a split second.

@soosr
Copy link
Collaborator

soosr commented Mar 1, 2024

When the balance is zero and you receive some bitcoin you will see 100 % for a split second.

I can repro, @ichthus1604 please take a look.

@@ -233,7 +233,7 @@ public int GetPrivacyPercentage()
{
var currentPrivacyScore = Coins.Sum(x => x.Amount.Satoshi * Math.Min(x.HdPubKey.AnonymitySet - 1, x.IsPrivate(AnonScoreTarget) ? AnonScoreTarget - 1 : AnonScoreTarget - 2));
var maxPrivacyScore = Coins.TotalAmount().Satoshi * (AnonScoreTarget - 1);
int pcPrivate = maxPrivacyScore == 0M ? 100 : (int)(currentPrivacyScore * 100 / maxPrivacyScore);
int pcPrivate = maxPrivacyScore == 0M ? 0 : (int)(currentPrivacyScore * 100 / maxPrivacyScore);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could someone from the @zkSNACKs/code-team verify that this doesn't break anything in CJ code? @adamPetho @molnard

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've looked and I think it's OK because we are in cases where we don't have any coins anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

@yahiheb yahiheb left a comment

Choose a reason for hiding this comment

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

tACK

@soosr soosr merged commit 9b3325a into zkSNACKs:master Mar 14, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Privacy tile suggestions
4 participants