From 61aca698874d55418c62f4dc65eabed9dd063d29 Mon Sep 17 00:00:00 2001 From: liyukun Date: Thu, 31 Aug 2023 10:31:00 +0800 Subject: [PATCH] chore: update workflow and clarify script_search_mode --- .github/workflows/integration.yaml | 217 +++++------------- .github/workflows/rust.yml | 4 +- crates/relayer/src/chain/ckb4ibc.rs | 10 +- crates/relayer/src/chain/ckb4ibc/monitor.rs | 8 +- crates/relayer/src/chain/ckb4ibc/utils.rs | 9 +- tools/ckb4ibc-test/src/framework/utils/ckb.rs | 22 +- tools/ckb4ibc-test/src/tests/packet/utils.rs | 3 +- tools/forcerelay-test/src/lib.rs | 3 +- 8 files changed, 90 insertions(+), 186 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 861ee3a2e..12897647c 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -40,7 +40,7 @@ concurrency: jobs: integration-test: runs-on: ubuntu-20.04 - timeout-minutes: 90 + timeout-minutes: 180 strategy: fail-fast: false matrix: @@ -77,8 +77,8 @@ jobs: account_prefix: stride steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v18 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 with: install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' @@ -91,143 +91,31 @@ jobs: with: toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test args: -p ibc-integration-test --no-fail-fast --no-run - - uses: nick-fields/retry@v2 + - name: Install cargo-nextest + run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin + - name: Run integration test env: RUST_LOG: info RUST_BACKTRACE: 1 NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} - with: - max_attempts: 2 - timeout_minutes: 60 - command: | - nix shell .#python .#${{ matrix.chain.package }} -c cargo \ - test -p ibc-integration-test --no-fail-fast -- \ - --nocapture --test-threads=2 - - multi-chains-test: - runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/master' - timeout-minutes: 90 - strategy: - fail-fast: false - matrix: - first-package: - - package: gaia6 - chain_command_path: gaiad - account_prefix: cosmos - - package: gaia7 - chain_command_path: gaiad - account_prefix: cosmos - - package: gaia8 - chain_command_path: gaiad - account_prefix: cosmos - - package: ibc-go-v2-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v3-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v4-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v5-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v6-simapp - chain_command_path: simd - account_prefix: cosmos - - package: wasmd - chain_command_path: wasmd - account_prefix: wasm - - package: evmos - chain_command_path: evmosd - account_prefix: evmos - - package: osmosis - chain_command_path: osmosisd - account_prefix: osmo - second-package: - - package: gaia6 - chain_command_path: gaiad - account_prefix: cosmos - - package: gaia7 - chain_command_path: gaiad - account_prefix: cosmos - - package: gaia8 - chain_command_path: gaiad - account_prefix: cosmos - - package: ibc-go-v2-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v3-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v4-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v5-simapp - chain_command_path: simd - account_prefix: cosmos - - package: ibc-go-v6-simapp - chain_command_path: simd - account_prefix: cosmos - - package: wasmd - chain_command_path: wasmd - account_prefix: wasm - - package: evmos - chain_command_path: evmosd - account_prefix: evmos - - package: osmosis - chain_command_path: osmosisd - account_prefix: osmo - - steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v15 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v12 - with: - name: cosmos - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: test - args: -p ibc-integration-test --no-fail-fast --no-run - - uses: nick-fields/retry@v2 - env: - RUST_LOG: info - RUST_BACKTRACE: 1 - NO_COLOR_LOG: 1 - ACCOUNT_PREFIXES: ${{ matrix.first-package.account_prefix }},${{ matrix.second-package.account_prefix }} - with: - max_attempts: 3 - timeout_minutes: 45 - command: | - CHAIN_COMMAND_PATHS=$(nix shell .#${{ matrix.first-package.package }} -c which ${{ matrix.first-package.chain_command_path }}),$(nix shell .#${{ matrix.second-package.package }} -c which ${{ matrix.second-package.chain_command_path }}) \ - nix shell .#python -c cargo \ - test -p ibc-integration-test --no-fail-fast -- \ - --nocapture --test-threads=2 + run: | + nix shell .#python .#${{ matrix.chain.package }} -c \ + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 ordered-channel-test: runs-on: ubuntu-20.04 timeout-minutes: 90 steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v15 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 with: install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' @@ -240,25 +128,28 @@ jobs: with: toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test args: -p ibc-integration-test --no-fail-fast --no-run + - name: Install cargo-nextest + run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - env: RUST_LOG: info RUST_BACKTRACE: 1 NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 run: | - nix shell .#python .#gaia6-ordered -c cargo \ - test -p ibc-integration-test --features ordered --no-fail-fast -- \ - --nocapture --test-threads=1 test_ordered_channel + nix shell .#python .#gaia6-ordered -c \ + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ + --features ordered test_ordered_channel ica-filter-test: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v15 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 with: install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' @@ -271,20 +162,23 @@ jobs: with: toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test args: -p ibc-integration-test --no-fail-fast --no-run + - name: Install cargo-nextest + run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - env: RUST_LOG: info RUST_BACKTRACE: 1 NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 CHAIN_COMMAND_PATHS: icad run: | - nix shell .#python .#ica -c cargo \ - test -p ibc-integration-test --features ica --no-fail-fast -- \ - --nocapture --test-threads=1 test_ica_filter + nix shell .#python .#ica -c \ + cargo nextest run -p ibc-integration-test --features ica --no-fail-fast \ + --test-threads=2 test_ica_filter ics29-fee-test: runs-on: ubuntu-20.04 @@ -302,8 +196,8 @@ jobs: command: simd account_prefix: cosmos steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v15 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 with: install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' @@ -316,21 +210,24 @@ jobs: with: toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test args: -p ibc-integration-test --features ics29-fee --no-fail-fast --no-run + - name: Install cargo-nextest + run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - env: RUST_LOG: info RUST_BACKTRACE: 1 NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} run: | - nix shell .#${{ matrix.chain.package }} -c cargo \ - test -p ibc-integration-test --features ics29-fee --no-fail-fast -- \ - --nocapture --test-threads=1 fee:: + nix shell .#${{ matrix.chain.package }} -c \ + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ + --features ics29-fee fee:: forward-packet: runs-on: ubuntu-20.04 @@ -345,8 +242,8 @@ jobs: command: gaiad account_prefix: cosmos steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v15 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 with: install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' @@ -359,21 +256,24 @@ jobs: with: toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test args: -p ibc-integration-test --features forward-packet --no-fail-fast --no-run + - name: Install cargo-nextest + run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - env: RUST_LOG: info RUST_BACKTRACE: 1 NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} run: | - nix shell .#${{ matrix.chain.package }} -c cargo \ - test -p ibc-integration-test --features forward-packet --no-fail-fast -- \ - --nocapture --test-threads=1 forward:: + nix shell .#${{ matrix.chain.package }} -c \ + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ + --features forward-packet forward:: ics31: runs-on: ubuntu-20.04 @@ -385,8 +285,8 @@ jobs: command: gaiad,strided account_prefix: cosmos,stride steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v15 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 with: install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' @@ -399,21 +299,24 @@ jobs: with: toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test args: -p ibc-integration-test --features ics31 --no-fail-fast --no-run + - name: Install cargo-nextest + run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - env: RUST_LOG: info RUST_BACKTRACE: 1 NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} run: | - nix shell ${{ matrix.chain.package }} -c cargo \ - test -p ibc-integration-test --features ics31 --no-fail-fast -- \ - --nocapture --test-threads=1 ics31:: + nix shell ${{ matrix.chain.package }} -c \ + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ + --features ics31 ics31:: model-based-test: runs-on: ubuntu-20.04 @@ -423,8 +326,8 @@ jobs: gaiad: - gaia6 steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v15 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 with: install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' @@ -437,7 +340,7 @@ jobs: with: toolchain: stable override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test @@ -453,4 +356,4 @@ jobs: # .#apalache \ # -c cargo \ # test -p ibc-integration-test --features mbt --no-fail-fast -- \ - # --nocapture --test-threads=1 mbt + # --failure-output final --test-threads=2 --test-threads=1 mbt \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 61f72b70c..ae7b7355b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -96,7 +96,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: test - args: --all-features --no-fail-fast --workspace --exclude ibc-integration-test --exclude ckb4ibc-test -- --nocapture + args: --all-features --no-fail-fast --workspace --exclude ibc-integration-test --exclude ibc-test -- --nocapture # test-coverage: # runs-on: ubuntu-latest @@ -126,4 +126,4 @@ jobs: # uses: actions/upload-artifact@v2 # with: # name: code-coverage-report - # path: cobertura.xml + # path: cobertura.xml \ No newline at end of file diff --git a/crates/relayer/src/chain/ckb4ibc.rs b/crates/relayer/src/chain/ckb4ibc.rs index 1b3ba647b..1d2622ea7 100644 --- a/crates/relayer/src/chain/ckb4ibc.rs +++ b/crates/relayer/src/chain/ckb4ibc.rs @@ -76,7 +76,7 @@ use self::message::{convert_msg_to_ckb_tx, CkbTxInfo, Converter, MsgToTxConverte use self::monitor::Ckb4IbcEventMonitor; use self::utils::{ convert_port_id_to_array, get_channel_number, get_dummy_merkle_proof, get_encoded_object, - get_search_key, get_search_key_with_sudt, + get_prefix_search_key, get_search_key_with_sudt, }; use super::ckb::rpc_client::RpcClient; @@ -226,7 +226,7 @@ impl Ckb4IbcChain { .pack(), ) .build(); - let search_key = get_search_key(script); + let search_key = get_prefix_search_key(script); let packets = self .rpc_client .fetch_live_cells(search_key, limit, None) @@ -301,7 +301,7 @@ impl Ckb4IbcChain { .args(channel_args.to_args().pack()) .hash_type(ScriptHashType::Type.into()) .build(); - let search_key = get_search_key(script); + let search_key = get_prefix_search_key(script); let channel_future = self .rpc_client .fetch_live_cells(search_key, 1, None) @@ -781,7 +781,7 @@ impl ChainEndpoint for Ckb4IbcChain { }; let search_key = match symbol { Some(symbol) => get_search_key_with_sudt(lock_script, symbol, self.network()?)?, - None => get_search_key(lock_script), + None => get_prefix_search_key(lock_script), }; let asset_cells = self.rt @@ -973,7 +973,7 @@ impl ChainEndpoint for Ckb4IbcChain { .args("".pack()) .hash_type(ScriptHashType::Type.into()) .build(); - let search_key = get_search_key(script); + let search_key = get_prefix_search_key(script); let (limit, index) = { if let Some(pagination) = request.pagination { (pagination.limit as u32, pagination.offset as u32) diff --git a/crates/relayer/src/chain/ckb4ibc/monitor.rs b/crates/relayer/src/chain/ckb4ibc/monitor.rs index ce8d84955..7ea3de792 100644 --- a/crates/relayer/src/chain/ckb4ibc/monitor.rs +++ b/crates/relayer/src/chain/ckb4ibc/monitor.rs @@ -43,7 +43,7 @@ use crate::event::monitor::{Error, EventBatch, MonitorCmd, Next, Result, TxMonit use crate::event::IbcEventWithHeight; use super::cache_set::CacheSet; -use super::utils::{generate_connection_id, get_script_hash, get_search_key}; +use super::utils::{generate_connection_id, get_prefix_search_key, get_script_hash}; // TODO: add cell emitter here pub struct Ckb4IbcEventMonitor { @@ -129,7 +129,7 @@ impl Ckb4IbcEventMonitor { .hash_type(ScriptHashType::Type.into()) .args(client_id.as_bytes().pack()) .build(); - let key = get_search_key(script); + let key = get_prefix_search_key(script); let ((ibc_connection_cell, tx_hash), block_number) = self .search_and_extract( key, @@ -243,7 +243,7 @@ impl Ckb4IbcEventMonitor { .args(channel_args.get_prefix_for_searching_unopen().pack()) .build(); - let key = get_search_key(script); + let key = get_prefix_search_key(script); let identified_channel_ends = self .search_and_extract( key, @@ -332,7 +332,7 @@ impl Ckb4IbcEventMonitor { .hash_type(ScriptHashType::Type.into()) .args("".pack()) .build(); - let key = get_search_key(script); + let key = get_prefix_search_key(script); let ibc_packets = self .search_and_extract( key, diff --git a/crates/relayer/src/chain/ckb4ibc/utils.rs b/crates/relayer/src/chain/ckb4ibc/utils.rs index 0626eab31..5f01742f7 100644 --- a/crates/relayer/src/chain/ckb4ibc/utils.rs +++ b/crates/relayer/src/chain/ckb4ibc/utils.rs @@ -6,6 +6,7 @@ use ckb_ics_axon::consts::{CHANNEL_ID_PREFIX, CONNECTION_ID_PREFIX}; use ckb_ics_axon::object::Proofs as CkbProofs; use ckb_ics_axon::proof::ObjectProof; use ckb_sdk::constants::TYPE_ID_CODE_HASH; +use ckb_sdk::rpc::ckb_indexer::ScriptSearchMode; use ckb_sdk::rpc::ckb_light_client::{ScriptType, SearchKey, SearchKeyFilter}; use ckb_sdk::NetworkType; use ckb_types::core::ScriptHashType; @@ -124,7 +125,7 @@ pub fn get_connection_search_key( filter: None, with_data: None, group_by_transaction: None, - script_search_mode: None, + script_search_mode: Some(ScriptSearchMode::Exact), }) } @@ -163,14 +164,14 @@ pub fn get_packet_lock_script(converter: &impl MsgToTxConverter, args: Vec) .build() } -pub fn get_search_key(script: Script) -> SearchKey { +pub fn get_prefix_search_key(script: Script) -> SearchKey { SearchKey { script: script.into(), script_type: ScriptType::Lock, filter: None, with_data: Some(true), group_by_transaction: None, - script_search_mode: None, + script_search_mode: Some(ScriptSearchMode::Prefix), } } @@ -205,7 +206,7 @@ pub fn get_search_key_with_sudt( filter: Some(filter), with_data: Some(true), group_by_transaction: None, - script_search_mode: None, + script_search_mode: Some(ScriptSearchMode::Exact), }) } diff --git a/tools/ckb4ibc-test/src/framework/utils/ckb.rs b/tools/ckb4ibc-test/src/framework/utils/ckb.rs index 23b13e2c6..d00f52213 100644 --- a/tools/ckb4ibc-test/src/framework/utils/ckb.rs +++ b/tools/ckb4ibc-test/src/framework/utils/ckb.rs @@ -10,6 +10,7 @@ use ckb_ics_axon::object::State; use ckb_ics_axon::ChannelArgs; use ckb_jsonrpc_types::{Deserialize, JsonBytes, Status}; use ckb_sdk::constants::TYPE_ID_CODE_HASH; +use ckb_sdk::rpc::ckb_indexer::ScriptSearchMode; use ckb_sdk::rpc::ckb_light_client::{ScriptType, SearchKey}; use ckb_sdk::*; use ckb_types::core::ScriptHashType; @@ -314,7 +315,7 @@ pub fn fetch_ibc_connections(port: u32) -> IbcConnections { filter: None, with_data: None, group_by_transaction: None, - script_search_mode: None, + script_search_mode: Some(ScriptSearchMode::Exact), }; let mut loop_count = 0; loop { @@ -356,19 +357,16 @@ fn channel_id_to_u16(channel_id: &ChannelId) -> u16 { pub fn fetch_ibc_channel_cell(port: u32, port_id: [u8; 32], channel_id: &ChannelId) -> IbcChannel { let rpc_client = get_client(port); + let channel_args = ChannelArgs { + client_id: get_test_client_id().into(), + open: true, + channel_id: channel_id_to_u16(channel_id), + port_id, + }; let search_key = SearchKey { script: Script::new_builder() .code_hash(CHANNEL_CODE_HASH.pack()) - .args( - ChannelArgs { - client_id: get_test_client_id().into(), - open: true, - channel_id: channel_id_to_u16(channel_id), - port_id, - } - .to_args() - .pack(), - ) + .args(channel_args.to_args().pack()) .hash_type(ScriptHashType::Type.into()) .build() .into(), @@ -376,7 +374,7 @@ pub fn fetch_ibc_channel_cell(port: u32, port_id: [u8; 32], channel_id: &Channel filter: None, with_data: None, group_by_transaction: None, - script_search_mode: None, + script_search_mode: Some(ScriptSearchMode::Exact), }; let mut loop_count = 0; loop { diff --git a/tools/ckb4ibc-test/src/tests/packet/utils.rs b/tools/ckb4ibc-test/src/tests/packet/utils.rs index 9070d465b..72f8e9a3b 100644 --- a/tools/ckb4ibc-test/src/tests/packet/utils.rs +++ b/tools/ckb4ibc-test/src/tests/packet/utils.rs @@ -1,4 +1,5 @@ use ckb_jsonrpc_types::{OutputsValidator, TransactionView as JsonTxView}; +use ckb_sdk::rpc::ckb_indexer::ScriptSearchMode; use ckb_sdk::rpc::ckb_light_client::{Order, ScriptType, SearchKey}; use ckb_sdk::traits::SecpCkbRawKeySigner; use ckb_sdk::unlock::{ScriptSigner, SecpSighashScriptSigner}; @@ -201,10 +202,10 @@ pub fn wallet_balance( let search_key = SearchKey { script: script.clone().into(), script_type: ScriptType::Lock, - script_search_mode: None, filter: None, with_data: None, group_by_transaction: None, + script_search_mode: Some(ScriptSearchMode::Exact), }; let wallet_cells = rt .block_on(SdkRpcClient::new(ckb_url.clone()).get_cells( diff --git a/tools/forcerelay-test/src/lib.rs b/tools/forcerelay-test/src/lib.rs index f6803414f..2e38d5716 100644 --- a/tools/forcerelay-test/src/lib.rs +++ b/tools/forcerelay-test/src/lib.rs @@ -1,6 +1,7 @@ #[cfg(test)] mod tests { use ckb_sdk::constants::TYPE_ID_CODE_HASH; + use ckb_sdk::rpc::ckb_indexer::ScriptSearchMode; use ckb_sdk::{ rpc::ckb_light_client::{Cell, Order, ScriptType, SearchKey}, IndexerRpcClient, @@ -207,7 +208,7 @@ mod tests { filter: None, with_data: None, group_by_transaction: None, - script_search_mode: None, + script_search_mode: Some(ScriptSearchMode::Exact), }; let mut retry_time = 0;