From 6c0cb254d9fc800ce740587ff6c7b80f09541df9 Mon Sep 17 00:00:00 2001 From: homura Date: Thu, 20 Jun 2024 10:40:22 +0900 Subject: [PATCH] fix: default script search mode should be prefixed --- packages/ckb-indexer/src/ckbIndexerFilter.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/ckb-indexer/src/ckbIndexerFilter.ts b/packages/ckb-indexer/src/ckbIndexerFilter.ts index 0a8ff52e9..839b561e1 100644 --- a/packages/ckb-indexer/src/ckbIndexerFilter.ts +++ b/packages/ckb-indexer/src/ckbIndexerFilter.ts @@ -198,24 +198,25 @@ export function filterByLumosSearchKey( return false; } } - // Prefix mode - } else if (searchKey.scriptSearchMode === "prefix") { + // partial mode + } else if (searchKey.scriptSearchMode === "partial") { if (scriptType === "lock") { - if (!checkScriptWithPrefixMode(cellOutput.lock, script)) { + if (!checkScriptWithPartialMode(cellOutput.lock, script)) { return false; } } else { - if (!checkScriptWithPrefixMode(cellOutput.type, script)) { + if (!checkScriptWithPartialMode(cellOutput.type, script)) { return false; } } - } else if (searchKey.scriptSearchMode === "partial") { + } else { + // Prefix mode if (scriptType === "lock") { - if (!checkScriptWithPartialMode(cellOutput.lock, script)) { + if (!checkScriptWithPrefixMode(cellOutput.lock, script)) { return false; } } else { - if (!checkScriptWithPartialMode(cellOutput.type, script)) { + if (!checkScriptWithPrefixMode(cellOutput.type, script)) { return false; } }