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

refactor: rename to reqd_confs #353

Merged
merged 4 commits into from
Mar 21, 2024
Merged

refactor: rename to reqd_confs #353

merged 4 commits into from
Mar 21, 2024

Conversation

prestwich
Copy link
Member

Motivation

Clarify naming on pending transaction and associated structs

Solution

rename confirmations to reqd_confs

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@prestwich prestwich added the enhancement New feature or request label Mar 21, 2024
@prestwich prestwich self-assigned this Mar 21, 2024
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Needs a few more updates

@@ -108,18 +108,18 @@ impl<'a, N: Network, T: Transport + Clone> PendingTransactionBuilder<'a, N, T> {
}

/// Returns the number of confirmations to wait for.
pub const fn confirmations(&self) -> u64 {
self.config.confirmations()
pub const fn reqd_confs(&self) -> u64 {
Copy link
Member

@DaniPopes DaniPopes Mar 21, 2024

Choose a reason for hiding this comment

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

maybe #[doc(alias = "confirmations")] on at least one of these for discoverability?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll go ahead and alias them all 👍

@@ -108,18 +108,21 @@ impl<'a, N: Network, T: Transport + Clone> PendingTransactionBuilder<'a, N, T> {
}

/// Returns the number of confirmations to wait for.
Copy link
Member

@mattsse mattsse Mar 21, 2024

Choose a reason for hiding this comment

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

Suggested change
/// Returns the number of confirmations to wait for.
/// Returns the number of required confirmations to wait for.

or is this requested?
I also wouldn't mind if we use fn required_confirmations

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't mind any particular name. I suppose this gets used most often in new-lined builder patterns where fn name lenght is not a primary concern. so that means longer and clearer is better

@prestwich prestwich merged commit 9dbd8f3 into main Mar 21, 2024
16 checks passed
@prestwich prestwich deleted the prestwich/reqd-confs branch March 21, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants