diff --git a/.github/workflows/ci-data-wasm.yml b/.github/workflows/ci-data-wasm.yml index d2ba120..af2b1a6 100644 --- a/.github/workflows/ci-data-wasm.yml +++ b/.github/workflows/ci-data-wasm.yml @@ -6,16 +6,11 @@ on: ckb_light_client_url: description: 'CKB Light Client Repository URL' required: false - default: 'https://github.com/nervosnetwork/ckb-light-client.git' + default: 'https://github.com/Officeyutong/ckb-light-client.git' ckb_light_client_branch: description: 'CKB Light Client Branch' required: false - default: 'develop' - rusqlite: - description: 'Enable rusqlite feature' - required: false - default: '' - type: string + default: 'use-trait-for-storage-functions' push: branches: - master @@ -40,9 +35,8 @@ jobs: - name: prepare env id: runtest env: - CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/nervosnetwork/ckb-light-client.git' }} - CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'develop' }} - RUSQLITE: ${{ github.event.inputs.rusqlite }} + CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/Officeyutong/ckb-light-client.git' }} + CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'use-trait-for-storage-functions' }} run: | bash prepare_wasm.sh npm install --save-dev mocha @types/mocha chai @types/chai diff --git a/.github/workflows/ci-data.yml b/.github/workflows/ci-data.yml index 6e33ab5..e1cf30e 100644 --- a/.github/workflows/ci-data.yml +++ b/.github/workflows/ci-data.yml @@ -6,16 +6,11 @@ on: ckb_light_client_url: description: 'CKB Light Client Repository URL' required: false - default: 'https://github.com/nervosnetwork/ckb-light-client.git' + default: 'https://github.com/Officeyutong/ckb-light-client.git' ckb_light_client_branch: description: 'CKB Light Client Branch' required: false - default: 'develop' - rusqlite: - description: 'Enable rusqlite feature' - required: false - default: '' - type: string + default: 'use-trait-for-storage-functions' push: branches: - master @@ -28,6 +23,7 @@ jobs: fail-fast: false matrix: net: ['testnet_v1'] + rusqlite: [true, false] runs-on: ubuntu-latest steps: @@ -51,9 +47,9 @@ jobs: - name: prepare env id: runtest env: - CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/nervosnetwork/ckb-light-client.git' }} - CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'develop' }} - RUSQLITE: ${{ github.event.inputs.rusqlite }} + CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/Officeyutong/ckb-light-client.git' }} + CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'use-trait-for-storage-functions' }} + RUSQLITE: ${{ matrix.rusqlite && '1' || '' }} run: | npm install --save-dev mocha @types/mocha chai @types/chai sh prepare.sh diff --git a/.github/workflows/ci-dev.yml b/.github/workflows/ci-dev.yml index 06ae7d9..b7265a4 100644 --- a/.github/workflows/ci-dev.yml +++ b/.github/workflows/ci-dev.yml @@ -6,16 +6,11 @@ on: ckb_light_client_url: description: 'CKB Light Client Repository URL' required: false - default: 'https://github.com/nervosnetwork/ckb-light-client.git' + default: 'https://github.com/Officeyutong/ckb-light-client.git' ckb_light_client_branch: description: 'CKB Light Client Branch' required: false - default: 'develop' - rusqlite: - description: 'Enable rusqlite feature' - required: false - default: '' - type: string + default: 'use-trait-for-storage-functions' push: branches: - master @@ -28,6 +23,7 @@ jobs: fail-fast: false matrix: net: ['testnet_v1'] + rusqlite: [true, false] runs-on: ubuntu-latest steps: @@ -40,9 +36,9 @@ jobs: - name: prepare env id: runtest env: - CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/nervosnetwork/ckb-light-client.git' }} - CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'develop' }} - RUSQLITE: ${{ github.event.inputs.rusqlite }} + CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/Officeyutong/ckb-light-client.git' }} + CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'use-trait-for-storage-functions' }} + RUSQLITE: ${{ matrix.rusqlite && '1' || '' }} run: | npm install --save-dev mocha @types/mocha chai @types/chai sh prepare_dev.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bbdc23..68b6620 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,6 @@ name: ci on: - workflow_dispatch: - inputs: - ckb_light_client_url: - description: 'CKB Light Client Repository URL' - required: false - default: 'https://github.com/nervosnetwork/ckb-light-client.git' - ckb_light_client_branch: - description: 'CKB Light Client Branch' - required: false - default: 'develop' - rusqlite: - description: 'Enable rusqlite feature' - required: false - default: '' - type: string push: branches: - master diff --git a/.github/workflows/ckb-light-client-ci-wasm.yml b/.github/workflows/ckb-light-client-ci-wasm.yml index 0e58723..ee6c547 100644 --- a/.github/workflows/ckb-light-client-ci-wasm.yml +++ b/.github/workflows/ckb-light-client-ci-wasm.yml @@ -6,16 +6,12 @@ on: ckb_light_client_url: description: 'CKB Light Client Repository URL' required: false - default: 'https://github.com/nervosnetwork/ckb-light-client.git' + default: 'https://github.com/Officeyutong/ckb-light-client.git' ckb_light_client_branch: description: 'CKB Light Client Branch' required: false - default: 'develop' - rusqlite: - description: 'Enable rusqlite feature' - required: false - default: '' - type: string + default: 'use-trait-for-storage-functions' + push: branches: - master @@ -53,9 +49,9 @@ jobs: - name: prepare env id: runtest env: - CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/nervosnetwork/ckb-light-client.git' }} - CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'develop' }} - RUSQLITE: ${{ github.event.inputs.rusqlite }} + CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/Officeyutong/ckb-light-client.git' }} + CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'use-trait-for-storage-functions' }} + RUSQLITE: ${{ matrix.rusqlite && '1' || '' }} run: | npm install --save-dev mocha @types/mocha chai @types/chai bash prepare_wasm.sh diff --git a/.github/workflows/ckb-light-client-ci.yml b/.github/workflows/ckb-light-client-ci.yml index 92b244c..53cb319 100644 --- a/.github/workflows/ckb-light-client-ci.yml +++ b/.github/workflows/ckb-light-client-ci.yml @@ -6,16 +6,11 @@ on: ckb_light_client_url: description: 'CKB Light Client Repository URL' required: false - default: 'https://github.com/nervosnetwork/ckb-light-client.git' + default: 'https://github.com/Officeyutong/ckb-light-client.git' ckb_light_client_branch: description: 'CKB Light Client Branch' required: false - default: 'develop' - rusqlite: - description: 'Enable rusqlite feature' - required: false - default: '' - type: string + default: 'use-trait-for-storage-functions' push: branches: - master @@ -28,6 +23,7 @@ jobs: fail-fast: false matrix: net: ['testnet_v1'] + rusqlite: [true, false] runs-on: ubuntu-latest steps: @@ -51,9 +47,9 @@ jobs: - name: prepare env id: runtest env: - CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/nervosnetwork/ckb-light-client.git' }} - CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'develop' }} - RUSQLITE: ${{ github.event.inputs.rusqlite }} + CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/Officeyutong/ckb-light-client.git' }} + CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'use-trait-for-storage-functions' }} + RUSQLITE: ${{ matrix.rusqlite && '1' || '' }} run: | npm install --save-dev mocha @types/mocha chai @types/chai sh prepare.sh diff --git a/.github/workflows/ckb-light-client-roll-back.yml b/.github/workflows/ckb-light-client-roll-back.yml index 206744e..737dbd9 100644 --- a/.github/workflows/ckb-light-client-roll-back.yml +++ b/.github/workflows/ckb-light-client-roll-back.yml @@ -6,16 +6,11 @@ on: ckb_light_client_url: description: 'CKB Light Client Repository URL' required: false - default: 'https://github.com/nervosnetwork/ckb-light-client.git' + default: 'https://github.com/Officeyutong/ckb-light-client.git' ckb_light_client_branch: description: 'CKB Light Client Branch' required: false - default: 'develop' - rusqlite: - description: 'Enable rusqlite feature' - required: false - default: '' - type: string + default: 'use-trait-for-storage-functions' @@ -25,6 +20,7 @@ jobs: fail-fast: false matrix: net: ['testnet_v1'] + rusqlite: [true, false] runs-on: ubuntu-latest steps: @@ -50,9 +46,9 @@ jobs: - name: test id: runtest env: - CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/nervosnetwork/ckb-light-client.git' }} - CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'develop' }} - RUSQLITE: ${{ github.event.inputs.rusqlite }} + CKB_LIGHT_CLIENT_URL: ${{ github.event.inputs.ckb_light_client_url || 'https://github.com/Officeyutong/ckb-light-client.git' }} + CKB_LIGHT_CLIENT_BRANCH: ${{ github.event.inputs.ckb_light_client_branch || 'use-trait-for-storage-functions' }} + RUSQLITE: ${{ matrix.rusqlite && '1' || '' }} run: | npm install --save-dev mocha @types/mocha chai @types/chai sh prepare.sh diff --git a/.gitmodules b/.gitmodules index 8e8f007..e011581 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "ckb-light-wasm-demo"] path = ckb-light-wasm-demo url = https://github.com/gpBlockchain/ckb-light-wasm-demo.git + branch = main diff --git a/ckb-light-wasm-demo b/ckb-light-wasm-demo index a25da4a..9b7ea45 160000 --- a/ckb-light-wasm-demo +++ b/ckb-light-wasm-demo @@ -1 +1 @@ -Subproject commit a25da4a7d2a31d2a1bdb9fe6858d607d3a784302 +Subproject commit 9b7ea45797277e8905bc8b519f9e8ff0987f5803 diff --git a/prepare_dev.sh b/prepare_dev.sh index 578b3bd..11a5683 100644 --- a/prepare_dev.sh +++ b/prepare_dev.sh @@ -4,4 +4,4 @@ git clone https://github.com/gpBlockchain/startBlockchain.git cd startBlockchain cd ckbDevWithIndexAndLightClient sh prepare.sh -sh start.sh \ No newline at end of file +sh start.sh diff --git a/prepare_wasm.sh b/prepare_wasm.sh index 8a13636..f72bbde 100644 --- a/prepare_wasm.sh +++ b/prepare_wasm.sh @@ -8,4 +8,4 @@ git submodule update cd ckb-light-client git log -1 cd ../ -bash build.sh \ No newline at end of file +bash build.sh diff --git a/service/CkbDevService.ts b/service/CkbDevService.ts index b0e2072..d615287 100644 --- a/service/CkbDevService.ts +++ b/service/CkbDevService.ts @@ -133,7 +133,7 @@ export async function cleanCkbLightClientEnv() { } export async function stopCkbLightClient() { - await shWithTimeOutNotErr("pkill ckb-light-client",1000) + await shWithTimeOutNotErr("pkill ckb-light",1000) } export async function startCkbLightClient() { diff --git a/test/dev/ckbLightClientCut.spec.ts b/test/dev/ckbLightClientCut.spec.ts index ffd642b..f0de3fe 100644 --- a/test/dev/ckbLightClientCut.spec.ts +++ b/test/dev/ckbLightClientCut.spec.ts @@ -84,7 +84,8 @@ describe('rollback', function () { it("transfer roll back ", async () => { // await miner_block_until_number(1100) await cleanAndRestartCkbLightClientEnv() - // await initLightClient() + await Sleep(3000); + await initLightClient() await miner_block() for (let i = 0; i < 2; i++) { await transfer_cut_and_wait_light_sync(80)