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

[trivial] Services: Add SmartHeaderChain #11522

Merged

Conversation

kiminuo
Copy link
Collaborator

@kiminuo kiminuo commented Sep 20, 2023

No description provided.

@kiminuo kiminuo changed the title Services: Add SmartHeaderChain [trivial] Services: Add SmartHeaderChain Sep 20, 2023
@kiminuo kiminuo marked this pull request as ready for review September 20, 2023 09:32
@@ -24,7 +24,7 @@ public static LabelsArray GetLabels(this SmartCoin coin, int privateThreshold)
return coin.HdPubKey.Cluster.Labels;
}

public static int GetConfirmations(this SmartCoin coin) => coin.Height.Type == HeightType.Chain ? (int)Services.BitcoinStore.SmartHeaderChain.TipHeight - coin.Height.Value + 1 : 0;
public static int GetConfirmations(this SmartCoin coin) => coin.Height.Type == HeightType.Chain ? (int)Services.SmartHeaderChain.TipHeight - coin.Height.Value + 1 : 0;
Copy link
Collaborator

@adamPetho adamPetho Sep 20, 2023

Choose a reason for hiding this comment

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

This whole function feels like a duplicate.

WDYT of this?

public static int GetConfirmations(this SmartCoin coin) => coin.Transaction.GetConfirmations((int)Services.BitcoinStore.SmartHeaderChain.TipHeight);

As SmartCoin has its own SmartTransaction, we could use that.

Copy link
Collaborator

@adamPetho adamPetho Sep 20, 2023

Choose a reason for hiding this comment

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

Oh shit, I forgot that the SmartTransaction.GetConfirmations extension method is not yet on master. 😅

EDIT: If you merge master now, it's there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a good point. I'll leave it for a follow-up PR but you can create a PR if you like.

# Conflicts:
#	WalletWasabi.Fluent/Extensions/TransactionSummaryExtensions.cs
Copy link
Collaborator

@adamPetho adamPetho left a comment

Choose a reason for hiding this comment

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

tACK

@adamPetho adamPetho merged commit b0fe827 into WalletWasabi:master Sep 20, 2023
7 checks passed
@kiminuo kiminuo deleted the feature/2023-09-20-UI-Services-simplify branch September 20, 2023 13:06
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.

None yet

2 participants