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

Only return awaiting confirmations count if it is required #1507

Merged
merged 3 commits into from
May 7, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented May 6, 2024

Summary

awaitingConfirmation was previously being calculated according to whether walletAddress had submitted a confirmation, regardless of whether a sufficient confirmations exist. This meant that a fully confirmed transaction, when not signed by the given walletAddress, would still increase the awaiting confirmation count.

This now takes confirmationsRequired into account, only returning an awaiting count if it is > 0.

Changes

  • Take the confirmationsRequired into account when increasing the awaiting confirmation count
  • Add test coverage

@iamacook iamacook self-assigned this May 6, 2024
@iamacook iamacook requested a review from a team as a code owner May 6, 2024 14:01
@coveralls
Copy link

coveralls commented May 6, 2024

Pull Request Test Coverage Report for Build 8970682678

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 93.03%

Files with Coverage Reduction New Missed Lines %
src/routes/transactions/entities/tests/human-description.builder.ts 2 80.0%
Totals Coverage Status
Change from base Build 8970019120: -0.04%
Covered Lines: 7016
Relevant Lines: 7268

💛 - Coveralls

return args.transactions.reduce(
(acc, { confirmationsRequired, confirmations }) => {
const isConfirmed = confirmationsRequired === 0;
const isSignedByWallet = confirmations?.some((confirmation) => {
Copy link
Member

@katspaugh katspaugh May 6, 2024

Choose a reason for hiding this comment

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

A slight optimization

Suggested change
const isSignedByWallet = confirmations?.some((confirmation) => {
const isSignable = !isConfirmed && !confirmations?.some((confirmation) => {

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 1dcf67e.

@iamacook iamacook enabled auto-merge (squash) May 6, 2024 14:23
@iamacook iamacook merged commit b5306a4 into main May 7, 2024
16 checks passed
@iamacook iamacook deleted the overview-awaiting-confirmations-count branch May 7, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants