forked from ckb-js/lumos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: incompatible types in indexer and rpc (ckb-js#385)
* chore(release): publish v0.19.0-alpha.0 * fix base export * fix api.d.ts * use base types in rpc * add test cases * add ref for hardforkFeatures * update migration guide Co-authored-by: homura <homura.dev@gmail.com>
- Loading branch information
1 parent
5c9cdb1
commit b8e4d10
Showing
41 changed files
with
359 additions
and
616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
import { Script } from "@ckb-lumos/base"; | ||
import type * as RPCType from "./rpcType"; | ||
import { SearchKey, SearchFilter } from "./type"; | ||
|
||
const toScript = (data: Script): RPCType.Script => ({ | ||
code_hash: data.codeHash, | ||
hash_type: data.hashType, | ||
args: data.args, | ||
}); | ||
export { toScript }; | ||
|
||
const toSearchFilter = (data: SearchFilter): RPCType.SearchFilter => { | ||
return { | ||
script: data.script ? toScript(data.script) : data.script, | ||
output_data_len_range: data.outputDataLenRange, | ||
output_capacity_range: data.outputCapacityRange, | ||
block_range: data.blockRange, | ||
}; | ||
}; | ||
|
||
const toSearchKey = (data: SearchKey): RPCType.SearchKey => ({ | ||
script: toScript(data.script), | ||
script_type: data.scriptType, | ||
filter: data.filter ? toSearchFilter(data.filter) : data.filter, | ||
}); | ||
|
||
export { toScript, toSearchKey, toSearchFilter }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.