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

chore: fix the phantom token details page that appears for unsubmitted txs #357

Merged
merged 4 commits into from
May 24, 2024

Conversation

npty
Copy link
Member

@npty npty commented Apr 30, 2024

Description

AXE-3890

Regarding to #354 and #349 issues:

  1. When the user clicks "Register on x chain" button, we save all the token details in the postgres db first before generating transaction data for the user to sign (before the browser wallet is pop-up).

  2. After the user submitted the transaction, we then update the record that we've saved in the previous step with deploymentMessageId: '${txHash}-${txIndex}'.

  3. However, when the user visits the token details page, we haven't checked if the user submitted the transaction from the deploymentMessageId field. We show the full token details UI page if there's any row in the db that associated with the token address.

  4. The issue arises if the transaction wasn't actually sent out to the blockchain, for instance, the user denies or closes the tx pop-up window, the transaction was dropped due to low gas price, etc.

This PR addresses the situations where the token details page was displaying incorrect information when the token registration transaction was not successfully submitted to the blockchain.

How this PR fixes the issue

This PR checks the deploymentMessageId field on the token details page to determine if the transaction was successfully submitted.

  • If deploymentMessageId exists, it displays the "Full Token Details" UI, indicating the token registration process is complete:

Transaction Submitted UI

  • If deploymentMessageId is absent, it displays the "Register Token" UI, allowing the user to initiate the registration process:

Register Token UI

Other changes

  • Updated drizzle-kit to the latest version for compatibility with other dependencies.
  • Moved README.md to apps/maestro/src/lib/drizzle/docs/ to resolve errors with drizzle:* commands during development.

Copy link

changeset-bot bot commented Apr 30, 2024

⚠️ No Changeset found

Latest commit: 5f50740

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
axelar-maestro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 9:45am
axelar-registry ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 9:45am
axelar-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 9:45am

@npty npty self-assigned this Apr 30, 2024
@npty npty requested review from canhtrinh and benjamin852 April 30, 2024 10:13
@npty npty changed the title chore: fix token id appears for unsubmitted tx chore: fix the phantom token details page that appears for unsubmitted tx Apr 30, 2024
@npty npty changed the title chore: fix the phantom token details page that appears for unsubmitted tx chore: fix the phantom token details page that appears for unsubmitted txs Apr 30, 2024
@npty npty added the bug Something isn't working label Apr 30, 2024
@npty
Copy link
Member Author

npty commented May 1, 2024

@canhtrinh I've tested the following scenario which similar to what we've discussed in the meeting:

  1. Trying to deploy the token on BNB chain along with 3 remote chains: Avalanche, Filecoin, Base.
  2. When the metamask window appears, i close it.
  3. I notice that there's 1 record was added to the interchain_tokens table and 3 records were added to the remote_interchain_tokens table. All of them have empty deployment_message_id.
  4. I've reloaded the token detail page and I don't see the phantom token details ui anymore which is great. Then, I click the Register button again.
  5. This time I selected only Avalanche for the remote chain and submitted the tx.
  6. I checked the database again and found that the deployment_message_id field for BNB and Avalanche chains are now updated with non-empty value.
  7. I reloaded the web page again and found that it renders correctly. Only Avalanche and BNB chain are registered.

image

And the data in the remote_interchain_token table looks like the following table:

id token_id axelar_chain_id token_address token_manager_address token_manager_type deployment_message_id deployment_status created_at updated_at
filecoin:0xa75d5B9F3791d237bf18555B010E59CB92479d0d 0x35b8bb3131982515f0c636544847d79b0bf708b506ad2d1c1ef3f79b27a64bf2 filecoin 0xa75d5B9F3791d237bf18555B010E59CB92479d0d 0xDf5BC2edA94F3BAF5eD6223672759bbcD58157bA mint_burn pending 2024-05-01T05:05:49.346Z 2024-05-01T05:06:52.419Z
base:0xa75d5B9F3791d237bf18555B010E59CB92479d0d 0x35b8bb3131982515f0c636544847d79b0bf708b506ad2d1c1ef3f79b27a64bf2 base 0xa75d5B9F3791d237bf18555B010E59CB92479d0d 0xDf5BC2edA94F3BAF5eD6223672759bbcD58157bA mint_burn pending 2024-05-01T05:05:49.346Z 2024-05-01T05:06:52.465Z
avalanche:0xa75d5B9F3791d237bf18555B010E59CB92479d0d 0x35b8bb3131982515f0c636544847d79b0bf708b506ad2d1c1ef3f79b27a64bf2 avalanche 0xa75d5B9F3791d237bf18555B010E59CB92479d0d 0xDf5BC2edA94F3BAF5eD6223672759bbcD58157bA mint_burn 0x91a6f0896f03bd5cb7f1000b5bcde835486f41061c4099735c13d8d687223f3f-49 confirmed 2024-05-01T05:05:49.346Z 2024-05-01T05:10:50.482Z

@npty npty requested a review from SGiaccobasso May 21, 2024 13:44
@npty npty merged commit 6ee29ad into main May 24, 2024
4 of 5 checks passed
@npty npty deleted the chore/fix-token-id-appears-for-unregistered-tokens branch May 24, 2024 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working interchain-portal-0.3.12
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants