Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: filter script by len range #54

Merged
merged 1 commit into from
Jun 13, 2022
Merged

Conversation

quake
Copy link
Member

@quake quake commented Jun 9, 2022

Using a different solution than #48 to solve the issue #47

this PR allows user to filter empty type script cells by setting script_len_range to [0, 1), script_len is caculated by (code_hash + hash_type + args).len

echo '{
    "id": 2,
    "jsonrpc": "2.0",
    "method": "get_cells",
    "params": [
        {
            "script": {
                "code_hash": "0x86a1c6987a4acbe1a887cca4c9dd2ac9fcb07405bbeda51b861b18bbf7492c4b",
                "hash_type": "type",
                "args": "0xb728659574c85e88d957bd643bb747a00f018d72"
            },
            "script_type": "lock",
            "filter": {
                "script_len_range": ["0x0", "0x1"]
            }
        },
        "asc",
        "0x64"
    ]
}' \
| tr -d '\n' \
| curl -H 'content-type: application/json' -d @- \
http://localhost:8116

@quake quake requested a review from doitian June 9, 2022 05:39
@quake quake merged commit 0f89477 into master Jun 13, 2022
@quake quake deleted the quake/filter-script-len-range branch July 11, 2022 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants