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

Remove more direct indexing #429

Merged
merged 2 commits into from
May 17, 2024
Merged

Conversation

keithtensor
Copy link
Contributor

Removes more cases of direct indexing.

@keithtensor keithtensor requested a review from a team May 16, 2024 17:11
let hotkey_pubkey: MultiAddress<T::AccountId, ()> = MultiAddress::Id(hotkey.clone());
let binding = hotkey_pubkey.encode();
// Skip extra 0th byte.
let hotkey_bytes: &[u8] = binding[1..].as_ref();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I'm fairly certain but not 100% sure -- it's actually trying to skip the discriminant byte from the MultiAddress enum, right? If so, we can just encode the hotkey directly, as I've done in my PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems right to me

Copy link
Contributor

@camfairchild camfairchild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good here.

@distributedstatemachine distributedstatemachine requested a review from a team May 16, 2024 17:24
@sam0x17 sam0x17 merged commit d5d20a3 into development May 17, 2024
8 checks passed
@sam0x17 sam0x17 deleted the fix-remaining-direct-indexing branch May 17, 2024 04:39
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.

None yet

4 participants