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 solana-sdk from solana-vote #4358

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

kevinheavey
Copy link

Problem

This crate no longer needs all of solana-sdk

Summary of Changes

Replace with component crates

Comment on lines +44 to +47
match limited_deserialize(
vote_instruction_data,
solana_packet::PACKET_DATA_SIZE as u64,
)
Copy link

Choose a reason for hiding this comment

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

god I hate our sdk code lol.

There's a sdk/program_utils.rs which has limited_deserialize, which is what this used to call.
That fn is just a wrapper around what this is now doing:

pub fn limited_deserialize<T>(instruction_data: &[u8]) -> Result<T, InstructionError>
where
    T: serde::de::DeserializeOwned,
{
    solana_program::program_utils::limited_deserialize(
        instruction_data,
        crate::packet::PACKET_DATA_SIZE as u64,
    )
}

that fn is itself just a wrapper around bincode::deserialize_from with specific options set...or re-created each time.

Change here is simply because that function and the program_utils module are still part of sdk rather than their own crate.

@kevinheavey kevinheavey added the automerge automerge Merge this Pull Request automatically once CI passes label Jan 9, 2025
@mergify mergify bot merged commit b2ba133 into anza-xyz:master Jan 9, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge Merge this Pull Request automatically once CI passes need:merge-assist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants