Skip to content

Use scalecodec rather than bt-decode for query_multi#152

Merged
thewhaleking merged 2 commits intomainfrom
fix/thewhaleking/use-scalecodec-for-query-multi
Jul 18, 2025
Merged

Use scalecodec rather than bt-decode for query_multi#152
thewhaleking merged 2 commits intomainfrom
fix/thewhaleking/use-scalecodec-for-query-multi

Conversation

@thewhaleking
Copy link
Collaborator

Catches edgecases where the storage-key has greater context than bt-decode can handle, such as when the result for a query where scale_info::180 = "FixedU128" results in a result of b"\x00".

The storagekey is aware of the context that the result should actually be b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

and so correctly decodes it as {"bits": 0} rather than raising a ValueError.

@thewhaleking thewhaleking requested a review from a team July 18, 2025 15:50
@github-actions github-actions bot added run-bittensor-sdk-tests Runs Bittensor SDK tests. run-bittensor-cli-tests Runs BTCLI tests. labels Jul 18, 2025
thewhaleking added a commit to opentensor/bittensor that referenced this pull request Jul 18, 2025
@thewhaleking thewhaleking merged commit 6ac54bf into main Jul 18, 2025
41 of 42 checks passed
@thewhaleking thewhaleking deleted the fix/thewhaleking/use-scalecodec-for-query-multi branch July 18, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-bittensor-cli-tests Runs BTCLI tests. run-bittensor-sdk-tests Runs Bittensor SDK tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants