Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions serialize-utils/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ pub fn read_u8<T: AsRef<[u8]>>(cursor: &mut Cursor<T>) -> Result<u8, Instruction
Ok(buf[0])
}

pub fn read_u16<T: AsRef<[u8]>>(cursor: &mut Cursor<T>) -> Result<u16, InstructionError> {
let mut buf = [0; 2];
cursor
.read_exact(&mut buf)
.map_err(|_| InstructionError::InvalidAccountData)?;

Ok(u16::from_le_bytes(buf))
}

pub fn read_u32<T: AsRef<[u8]>>(cursor: &mut Cursor<T>) -> Result<u32, InstructionError> {
let mut buf = [0; 4];
cursor
Expand Down
4 changes: 4 additions & 0 deletions vote-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ frozen-abi = [
"solana-short-vec/frozen-abi",
]
serde = [
"dep:cfg_eval",
"dep:serde",
"dep:serde_derive",
"dep:serde_with",
"dep:solana-serde-varint",
"dep:solana-short-vec",
"solana-hash/serde",
Expand All @@ -46,10 +48,12 @@ serde = [
[dependencies]
arbitrary = { workspace = true, features = ["derive"], optional = true }
bincode = { workspace = true, optional = true }
cfg_eval = { workspace = true, optional = true }
num-derive = { workspace = true }
num-traits = { workspace = true }
serde = { workspace = true, optional = true }
serde_derive = { workspace = true, optional = true }
serde_with = { workspace = true, features = ["macros"], optional = true }
solana-clock = { workspace = true }
solana-frozen-abi = { workspace = true, features = [
"frozen-abi",
Expand Down
4 changes: 2 additions & 2 deletions vote-interface/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use {
super::state::TowerSync,
crate::state::{
Vote, VoteAuthorize, VoteAuthorizeCheckedWithSeedArgs, VoteAuthorizeWithSeedArgs, VoteInit,
VoteStateUpdate, VoteStateVersions,
VoteStateUpdate, VoteStateV4,
},
solana_clock::{Slot, UnixTimestamp},
solana_hash::Hash,
Expand Down Expand Up @@ -272,7 +272,7 @@ pub struct CreateVoteAccountConfig<'a> {
impl Default for CreateVoteAccountConfig<'_> {
fn default() -> Self {
Self {
space: VoteStateVersions::vote_state_size_of(false) as u64,
space: VoteStateV4::size_of() as u64,
with_seed: None,
}
}
Expand Down
Loading