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

Try to auto-detect token type used in runtime transactions #1279

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

csillag
Copy link
Contributor

@csillag csillag commented Feb 21, 2024

Use tx.body to figure out if it's something special, or the default native token.

Copy link

github-actions bot commented Feb 21, 2024

Deployed to Cloudflare Pages

Latest commit: a16157bdf8933b970f380dd20bd77a12717bb673
Status:✅ Deploy successful!
Preview URL: https://2897aeff.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/better-runtime-tx-token-detection branch from 1da61cb to ebe0ff5 Compare February 21, 2024 04:34
@csillag csillag marked this pull request as ready for review February 21, 2024 04:34
Use tx.data to figure out if it's something special,
or the default native token.
@csillag csillag force-pushed the csillag/better-runtime-tx-token-detection branch from ebe0ff5 to a16157b Compare February 21, 2024 11:42
@csillag csillag merged commit 674ce6b into master Feb 21, 2024
8 checks passed
@csillag csillag deleted the csillag/better-runtime-tx-token-detection branch February 21, 2024 12:01
@@ -752,7 +752,9 @@ export const useGetRuntimeEvents: typeof generated.useGetRuntimeEvents = (
event.body.amount.Amount,
paraTimesConfig[runtime].decimals,
),
Denomination: getTokensForScope({ network, layer: runtime })[0].ticker, // TODO find this out from event data
Denomination:
event.body?.Denomination ??
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't exist. event.body?.amount.Denomination exists.
But event.body.amount.Denomination === '' above means that it is empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have seen both existing on different data, IIRC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, maybe not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, when this code is executed, it's always empty. Removed useless condition in #1285.

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.

3 participants