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; } }