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: duplicated bindings in the activity API #194

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

ShookLyngs
Copy link
Collaborator

@ShookLyngs ShookLyngs commented Jul 18, 2024

Previous PR

Changes

TODO

  • Test: query L1-L1 transactions
    • Query via route: /rgbpp/v1/address/tb1qrkh7g0gkllttvsu9kzm7f5c25agnj8ype88xsg/activity
    • View transaction on RGB++ Explorer
  • Test: query L1-L2 transactions
    • Query via route: /rgbpp/v1/address/tb1qrkh7g0gkllttvsu9kzm7f5c25agnj8ype88xsg/activity
    • View transaction on RGB++ Explorer
  • Test: query L1-L1/L2-l1 multi-bound UTXO
    1. L1-L1 that generates a new UTXO a986...245c:1
      • Query via route: /rgbpp/v1/address/tb1ql4rmhtkzdf043cq4a876y2fsq6wqqh02njwsf7/activity
      • View transaction on RGB++ Explorer
    2. L2-L1 that leaps asset to the same UTXO a986...245c:1

Issues

  1. We can only reverse search L1-L1 and L1-L2 transactions with BTC TxIds, as only these types of transactions will ensure at least one rgbpp-lock cell is included in the inputs. For other types of transactions, we will have trouble identifying duplicated binding assets in them.
  2. The RgbppCollector.queryBtcTimeLockTxByBtcTxId() method has an issue where the CkbIndexer.getTransactions() method requires manual pagination. This part is currently missing in the codebase, so the method only searches the first 100 records in the blockchain, causing inaccurate matching results of the btc-time-lock transactions.
    related issue: Optimize the search process for BTC_TIME_LOCK ckb transactions #45

Copy link

vercel bot commented Jul 18, 2024

@ShookLyngs is attempting to deploy a commit to the Cell Studio Team on Vercel.

To accomplish this, @ShookLyngs needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

Copy link

vercel bot commented Aug 21, 2024

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

Name Status Preview Comments Updated (UTC)
btc-assets-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 6:53pm

@ShookLyngs
Copy link
Collaborator Author

ShookLyngs commented Aug 21, 2024

@ahonn IS_MAINNET and TESTNET_TYPE are created in the constants.ts file to simplify things. If you are okay with the constants, I can create another PR to refactor the codebase to use these constants instead of using env.NETWORK everywhere:

-getXScript(env.NETWORK === NetworkType.mainnet.toString())
+getXScript(IS_MAINNET)

@ShookLyngs ShookLyngs changed the title [WIP] fix: duplicated bindings in the activity API fix: duplicated bindings in the activity API Aug 21, 2024
@ShookLyngs ShookLyngs marked this pull request as ready for review August 21, 2024 15:01
@ahonn
Copy link
Collaborator

ahonn commented Aug 21, 2024

@ahonn IS_MAINNET and TESTNET_TYPE are created in the constants.ts file to simplify things. If you are okay with the constants, I can create another PR to refactor the codebase to use these constants instead of using env.NETWORK everywhere:

-getXScript(env.NETWORK === NetworkType.mainnet.toString())

+getXScript(IS_MAINNET)

LGTM

@Flouse Flouse linked an issue Aug 21, 2024 that may be closed by this pull request
1 task
src/services/rgbpp.ts Outdated Show resolved Hide resolved
src/services/rgbpp.ts Outdated Show resolved Hide resolved
@Flouse
Copy link
Contributor

Flouse commented Aug 22, 2024

The preview deployment is ready. 🟢

Open Preview

Hi, @Dawn-githup
https://194.assets-api-342ddd42.nip.io/docs is the PR preview link for testing.

Related test

Copy link
Collaborator

@ahonn ahonn left a comment

Choose a reason for hiding this comment

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

LGTM

@Dawn-githup
Copy link
Collaborator

image

curl 'https://btc-assets-api-git-fix-182-duplicated-bindings-cell-studio.vercel.app/rgbpp/v1/address/tb1q4vsuv95gdum3cdrswujv9qzqf72ehqxh7vhhak/activity?rgbpp_only=false' \

It is recommended to cache the data. It takes a long time to check the data now.

@Dawn-githup
Copy link
Collaborator

The preview deployment is ready. 🟢
Open Preview

Hi, @Dawn-githup https://194.assets-api-342ddd42.nip.io/docs is the PR preview link for testing.

Related test

updated

#182 (comment)

@Flouse Flouse mentioned this pull request Aug 22, 2024
2 tasks
@Flouse Flouse merged commit 9ba1b70 into develop Aug 22, 2024
2 of 4 checks passed
@Flouse Flouse deleted the fix/182-duplicated-bindings branch August 22, 2024 08:54
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.

Review fn queryRgbppLockTxByBtcTx and queryBtcTimeLockTxByBtcTxId
4 participants