Skip to content

Commit

Permalink
fix: default script search mode should be prefixed
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Jun 20, 2024
1 parent dd042d7 commit 6c0cb25
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/ckb-indexer/src/ckbIndexerFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 6c0cb25

Please sign in to comment.