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

app: Fix amounts displayed for token transactions in tx history #2998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martonp
Copy link
Contributor

@martonp martonp commented Sep 29, 2024

When displaying token transactions on the wallet page for the parent asset, the unit info for the parent asset was being used, causing incorrect amounts.

Closes #2994

When displaying token transactions on the wallet page for the parent asset,
the unit info for the parent asset was being used, causing incorrect amounts.
Copy link
Contributor

@dev-warrior777 dev-warrior777 left a comment

Choose a reason for hiding this comment

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

Looks good. The linting issues are fixed in #2996

let amtAssetID = assetID
let feesAssetID = assetID
if (tx.tokenID) {
amtAssetID = tx.tokenID
Copy link
Member

Choose a reason for hiding this comment

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

Won't amtAssetID already be assetID?

let feesAssetID = assetID
if (tx.tokenID) {
amtAssetID = tx.tokenID
if (assetID !== tx.tokenID) feesAssetID = assetID
Copy link
Member

Choose a reason for hiding this comment

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

In what case would assetID no be tx.tokenID for a token tx?

}

const amt = Doc.formatCoinValue(tx.amount, app().unitInfo(assetID))
const amtUnit = app().assets[assetID].symbol.split('.')[0].toUpperCase()
Copy link
Member

Choose a reason for hiding this comment

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

I know this was wrong before, but we should be getting the ticker for an asset from its UnitInfo.

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.

ui: (wallet, transaction history) formatting issue for Amount
4 participants