From 68ae1c3b66b28573d63afd46781d6d6fea3a8c6d Mon Sep 17 00:00:00 2001 From: Dawn <13477199767@163.com> Date: Wed, 20 Nov 2024 09:25:10 +0800 Subject: [PATCH 1/2] test: Switching from Testnet3 to Signet for testing --- .github/workflows/integration-test.yaml | 12 ++++++------ tests/rgbpp/env.ts | 2 +- tests/rgbpp/shared/prepare-utxo.ts | 2 +- tests/rgbpp/spore/4-transfer-spore.ts | 2 +- tests/rgbpp/spore/5-leap-spore-to-ckb.ts | 2 +- tests/rgbpp/spore/launch/2-create-cluster.ts | 2 +- tests/rgbpp/spore/launch/3-create-spores.ts | 2 +- tests/rgbpp/xudt/2-btc-transfer.ts | 2 +- tests/rgbpp/xudt/3-btc-leap-ckb.ts | 2 +- .../xudt/btc-transfer-all/1-btc-transfer-all.ts | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 974f1862..efc0156b 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -49,9 +49,9 @@ jobs: if: ${{ matrix.env_set == 'xudt' }} run: pnpm run integration:xudt env: - VITE_SERVICE_URL: https://btc-assets-api.testnet.mibao.pro - VITE_SERVICE_TOKEN: ${{ secrets.TESTNET_SERVICE_TOKEN }} - VITE_SERVICE_ORIGIN: https://btc-assets-api.testnet.mibao.pro + VITE_SERVICE_URL: https://api.signet.rgbpp.io + VITE_SERVICE_TOKEN: ${{ secrets.SIGNET_SERVICE_TOKEN }} + VITE_SERVICE_ORIGIN: https://api.signet.rgbpp.io INTEGRATION_CKB_PRIVATE_KEY: ${{ secrets.INTEGRATION_CKB_PRIVATE_KEY }} INTEGRATION_BTC_PRIVATE_KEY: ${{ secrets.INTEGRATION_BTC_PRIVATE_KEY }} @@ -60,8 +60,8 @@ jobs: if: ${{ matrix.env_set == 'spore' }} run: pnpm run integration:spore env: - VITE_SERVICE_URL: https://btc-assets-api.testnet.mibao.pro - VITE_SERVICE_TOKEN: ${{ secrets.TESTNET_SERVICE_TOKEN }} - VITE_SERVICE_ORIGIN: https://btc-assets-api.testnet.mibao.pro + VITE_SERVICE_URL: https://api.signet.rgbpp.io + VITE_SERVICE_TOKEN: ${{ secrets.SIGNET_SERVICE_TOKEN }} + VITE_SERVICE_ORIGIN: https://api.signet.rgbpp.io INTEGRATION_CKB_PRIVATE_KEY: ${{ secrets.INTEGRATION_CKB_SPORE_PRIVATE_KEY }} INTEGRATION_BTC_PRIVATE_KEY: ${{ secrets.INTEGRATION_BTC_SPORE_PRIVATE_KEY }} diff --git a/tests/rgbpp/env.ts b/tests/rgbpp/env.ts index 030a9aa1..6a4ba5f7 100644 --- a/tests/rgbpp/env.ts +++ b/tests/rgbpp/env.ts @@ -15,7 +15,7 @@ dotenv.config({ path: __dirname + '/.env' }); export const isMainnet = false; -export const BTC_TESTNET_TYPE = 'Testnet3'; +export const BTC_TESTNET_TYPE = 'Signet'; export const collector = new Collector({ ckbNodeUrl: 'https://testnet.ckb.dev/rpc', diff --git a/tests/rgbpp/shared/prepare-utxo.ts b/tests/rgbpp/shared/prepare-utxo.ts index 6f68e39f..fd41ed02 100644 --- a/tests/rgbpp/shared/prepare-utxo.ts +++ b/tests/rgbpp/shared/prepare-utxo.ts @@ -30,7 +30,7 @@ const prepareUtxo = async (index: string | number) => { console.log(tx.toHex()); const { txid: btcTxId } = await btcService.sendBtcTransaction(tx.toHex()); - console.log(`explorer: https://mempool.space/testnet/tx/${btcTxId}`); + console.log(`explorer: https://mempool.space/signet/tx/${btcTxId}`); writeStepLog(String(index), { txid: btcTxId, diff --git a/tests/rgbpp/spore/4-transfer-spore.ts b/tests/rgbpp/spore/4-transfer-spore.ts index 2e979c5e..c6949a63 100644 --- a/tests/rgbpp/spore/4-transfer-spore.ts +++ b/tests/rgbpp/spore/4-transfer-spore.ts @@ -53,7 +53,7 @@ const transferSpore = async ({ sporeRgbppLockArgs, toBtcAddress, sporeTypeArgs } const { txId: btcTxId } = await signAndSendPsbt(psbt, btcAccount, btcService); console.log('BTC TxId: ', btcTxId); - console.log(`explorer: https://mempool.space/testnet/tx/${btcTxId}`); + console.log(`explorer: https://mempool.space/signet/tx/${btcTxId}`); await btcService.sendRgbppCkbTransaction({ btc_txid: btcTxId, ckb_virtual_result: ckbVirtualTxResult }); diff --git a/tests/rgbpp/spore/5-leap-spore-to-ckb.ts b/tests/rgbpp/spore/5-leap-spore-to-ckb.ts index 23679d0b..83b72f7b 100644 --- a/tests/rgbpp/spore/5-leap-spore-to-ckb.ts +++ b/tests/rgbpp/spore/5-leap-spore-to-ckb.ts @@ -54,7 +54,7 @@ const leapSporeFromBtcToCkb = async ({ sporeRgbppLockArgs, toCkbAddress, sporeTy const { txId: btcTxId } = await signAndSendPsbt(psbt, btcAccount, btcService); console.log('BTC TxId: ', btcTxId); - console.log(`explorer: https://mempool.space/testnet/tx/${btcTxId}`); + console.log(`explorer: https://mempool.space/signet/tx/${btcTxId}`); await btcService.sendRgbppCkbTransaction({ btc_txid: btcTxId, ckb_virtual_result: ckbVirtualTxResult }); diff --git a/tests/rgbpp/spore/launch/2-create-cluster.ts b/tests/rgbpp/spore/launch/2-create-cluster.ts index 20094f22..38719a58 100644 --- a/tests/rgbpp/spore/launch/2-create-cluster.ts +++ b/tests/rgbpp/spore/launch/2-create-cluster.ts @@ -60,7 +60,7 @@ const createCluster = async ({ ownerRgbppLockArgs }: { ownerRgbppLockArgs: strin index: 1, }); console.log('BTC TxId: ', btcTxId); - console.log(`explorer: https://mempool.space/testnet/tx/${btcTxId}`); + console.log(`explorer: https://mempool.space/signet/tx/${btcTxId}`); const interval = setInterval(async () => { try { diff --git a/tests/rgbpp/spore/launch/3-create-spores.ts b/tests/rgbpp/spore/launch/3-create-spores.ts index e38ef233..ab705a8f 100644 --- a/tests/rgbpp/spore/launch/3-create-spores.ts +++ b/tests/rgbpp/spore/launch/3-create-spores.ts @@ -67,7 +67,7 @@ const createSpores = async ({ clusterRgbppLockArgs, receivers }: SporeCreatePara txid: btcTxId, }); console.log('BTC TxId: ', btcTxId); - console.log(`explorer: https://mempool.space/testnet/tx/${btcTxId}`); + console.log(`explorer: https://mempool.space/signet/tx/${btcTxId}`); const interval = setInterval(async () => { try { diff --git a/tests/rgbpp/xudt/2-btc-transfer.ts b/tests/rgbpp/xudt/2-btc-transfer.ts index 09058437..a91dcd9d 100644 --- a/tests/rgbpp/xudt/2-btc-transfer.ts +++ b/tests/rgbpp/xudt/2-btc-transfer.ts @@ -45,7 +45,7 @@ const transfer = async ({ rgbppLockArgsList, toBtcAddress, xudtTypeArgs, transfe const psbt = bitcoin.Psbt.fromHex(btcPsbtHex); const { txId: btcTxId } = await signAndSendPsbt(psbt, btcAccount, btcService); console.log(`BTC ${BTC_TESTNET_TYPE} TxId: ${btcTxId}`); - console.log(`explorer: https://mempool.space/testnet/tx/${btcTxId}`); + console.log(`explorer: https://mempool.space/signet/tx/${btcTxId}`); writeStepLog('transfer-id', { txid: btcTxId, diff --git a/tests/rgbpp/xudt/3-btc-leap-ckb.ts b/tests/rgbpp/xudt/3-btc-leap-ckb.ts index 08b35543..efe38d90 100644 --- a/tests/rgbpp/xudt/3-btc-leap-ckb.ts +++ b/tests/rgbpp/xudt/3-btc-leap-ckb.ts @@ -55,7 +55,7 @@ const leapFromBtcToCKB = async ({ rgbppLockArgsList, toCkbAddress, xudtTypeArgs, const { txId: btcTxId } = await signAndSendPsbt(psbt, btcAccount, btcService); console.log(`BTC ${BTC_TESTNET_TYPE} TxId: ${btcTxId}`); - console.log(`explorer: https://mempool.space/testnet/tx/${btcTxId}`); + console.log(`explorer: https://mempool.space/signet/tx/${btcTxId}`); await btcService.sendRgbppCkbTransaction({ btc_txid: btcTxId, ckb_virtual_result: ckbVirtualTxResult }); diff --git a/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts b/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts index 147483e4..ac637bb3 100644 --- a/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts +++ b/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts @@ -63,7 +63,7 @@ const rgbppTransferAllTxs = async ({ xudtTypeArgs, fromAddress, toAddress }: Tes const successfulTxIds = sentGroups .filter((group) => group.btcTxId) - .map((group) => `https://mempool.space/testnet/tx/${group.btcTxId}`); + .map((group) => `https://mempool.space/signet/tx/${group.btcTxId}`); console.log('Successful Transactions:', successfulTxIds.join('\n')); From 9df8158e2d4a0c01fc0fc86cdf03df6411b163c1 Mon Sep 17 00:00:00 2001 From: Dawn <13477199767@163.com> Date: Fri, 22 Nov 2024 10:10:53 +0800 Subject: [PATCH 2/2] fix: Modify the feeRate of 1-btc-transfer-all case to be obtained dynamically --- tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts b/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts index ac637bb3..f9e1d166 100644 --- a/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts +++ b/tests/rgbpp/xudt/btc-transfer-all/1-btc-transfer-all.ts @@ -3,7 +3,7 @@ import { buildRgbppTransferAllTxs, sendRgbppTxGroups } from 'rgbpp'; import { btcDataSource, isMainnet, collector, btcAccount } from '../../env'; import { signPsbt } from '../../../../examples/rgbpp/shared/btc-account'; import { saveCkbVirtualTxResult } from '../../../../examples/rgbpp/shared/utils'; -import { readStepLog } from '../../shared/utils'; +import { getFastestFeeRate, readStepLog } from '../../shared/utils'; interface TestParams { xudtTypeArgs: string; @@ -12,6 +12,9 @@ interface TestParams { } const rgbppTransferAllTxs = async ({ xudtTypeArgs, fromAddress, toAddress }: TestParams) => { + const feeRate = await getFastestFeeRate(); + console.log('feeRate = ', feeRate); + const result = await buildRgbppTransferAllTxs({ ckb: { xudtTypeArgs, @@ -22,7 +25,7 @@ const rgbppTransferAllTxs = async ({ xudtTypeArgs, fromAddress, toAddress }: Tes fromAddress: fromAddress, toAddress: toAddress, dataSource: btcDataSource, - feeRate: 5, + feeRate: feeRate, }, isMainnet, });