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

fix(staking): zero amounts when bumping fee #15030

Merged

Conversation

dev-pvl
Copy link
Contributor

@dev-pvl dev-pvl commented Oct 23, 2024

Description

  • no satoshi methods for non-bitcoin
  • resolves zero amount issue when bumping fee during the unstake flow (proving amount)
  • resolves zero amount issue when bumping fee during the claim flow (hiding amount)
  • hide double label when bumping staking txs
  • hide 0 amount in left panel in tx review modal. Applies for claim bump and approve token swap tx

Related Issue

Resolve #13752
Resolve #13397

Screenshots:

bump-fee-zero-amount
Screenshot 2024-11-03 at 16 07 12
Screenshot 2024-11-03 at 16 06 06

@tomasklim tomasklim force-pushed the fix/staking-zero-amounts-when-bumping-fee branch from 51e001e to 6ada92e Compare October 23, 2024 11:04
@tomasklim tomasklim force-pushed the fix/staking-zero-amounts-when-bumping-fee branch 2 times, most recently from ec65227 to 98029fd Compare October 23, 2024 17:19
@tomasklim tomasklim mentioned this pull request Oct 23, 2024
Copy link
Member

@tomasklim tomasklim left a comment

Choose a reason for hiding this comment

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

Removing approve as in claiming tx, the amount is still 0

@dev-pvl
Copy link
Contributor Author

dev-pvl commented Oct 25, 2024

this fixup 2090878 hides zero amount for bump txs when claiming as was agreed

@omykhailovskyi
Copy link

Hey, @tomasklim
Any update on that?

@tomasklim tomasklim self-requested a review October 30, 2024 11:46
@tomasklim
Copy link
Member

@omykhailovskyi don't worry, the last commit is quite a big change and I wanted to go through really carefully

@tomasklim tomasklim force-pushed the fix/staking-zero-amounts-when-bumping-fee branch 3 times, most recently from fe65440 to 482fff9 Compare November 3, 2024 15:05
@tomasklim tomasklim mentioned this pull request Nov 3, 2024
Copy link
Member

@tomasklim tomasklim left a comment

Choose a reason for hiding this comment

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

Approving but waiting for also approve from somebody else as most of the commit are mine

@tomasklim tomasklim force-pushed the fix/staking-zero-amounts-when-bumping-fee branch from 482fff9 to 557db07 Compare November 3, 2024 19:51
@@ -362,7 +362,7 @@ export const formatAmount = (amount: BigNumberValue, decimals: number) => {
}
};

export const amountToSatoshi = (amount: BigNumberValue, decimals: number) => {
export const formatAmountWithDecimals = (amount: BigNumberValue, decimals: number) => {
Copy link
Member

Choose a reason for hiding this comment

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

Just a nitpick, but I think the new name makes it unclear what this function does.
It's named confusingly similarly to formatAmount function, but it does the opposite thing.
So maybe amountToSmallestUnit or normalizeAmount?

Copy link
Member

Choose a reason for hiding this comment

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

It is clear for me, but I will rename it. np

@tomasklim tomasklim force-pushed the fix/staking-zero-amounts-when-bumping-fee branch from 557db07 to 973274f Compare November 4, 2024 08:14
@tomasklim tomasklim merged commit 1b02b0c into trezor:develop Nov 4, 2024
105 of 111 checks passed
@tomasklim tomasklim deleted the fix/staking-zero-amounts-when-bumping-fee branch November 4, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants