Fix delegate info methods to return correct values #2567
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2564
Fix the issue with
bt_decode.DelegateInfo.decode_vec
inbittensor/core/chain_data/delegate_info.py
to handle the decoding ofvec_u8
correctly.from_vec_u8
to decodevec_u8
and return aDelegateInfo
object.list_from_vec_u8
method to correctly decodevec_u8
and return a list ofDelegateInfo
objects.total_daily_return
andreturn_per_1000
are correctly decoded and returned.Update
bittensor/core/chain_data/delegate_info_lite.py
to handle type conversions and ensure correct data types.from_raw_data
to create aDelegateInfoLite
instance from raw data with proper type conversions.registrations
andvalidator_permits
are lists of integers.take
is rounded to 6 decimal places andnominators
,return_per_1000
, andtotal_daily_return
are integers.For more details, open the Copilot Workspace session.