remove VoteState::deserialize() from sbf builds (#30515)
the existing deserialize implementation overruns the sbf stack and is unusable in a program context this silences a warning to that effect which all solana_program importers receive closes #30188
This commit is contained in:
parent
cbcd3ef27e
commit
bd49b984e2
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use crate::epoch_schedule::MAX_LEADER_SCHEDULE_EPOCH_OFFSET;
|
use crate::epoch_schedule::MAX_LEADER_SCHEDULE_EPOCH_OFFSET;
|
||||||
|
#[cfg(not(target_os = "solana"))]
|
||||||
|
use bincode::deserialize;
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
clock::{Epoch, Slot, UnixTimestamp},
|
clock::{Epoch, Slot, UnixTimestamp},
|
||||||
|
@ -12,7 +14,7 @@ use {
|
||||||
sysvar::clock::Clock,
|
sysvar::clock::Clock,
|
||||||
vote::{authorized_voters::AuthorizedVoters, error::VoteError},
|
vote::{authorized_voters::AuthorizedVoters, error::VoteError},
|
||||||
},
|
},
|
||||||
bincode::{deserialize, serialize_into, ErrorKind},
|
bincode::{serialize_into, ErrorKind},
|
||||||
serde_derive::{Deserialize, Serialize},
|
serde_derive::{Deserialize, Serialize},
|
||||||
std::{collections::VecDeque, fmt::Debug},
|
std::{collections::VecDeque, fmt::Debug},
|
||||||
};
|
};
|
||||||
|
@ -303,10 +305,15 @@ impl VoteState {
|
||||||
3731 // see test_vote_state_size_of.
|
3731 // see test_vote_state_size_of.
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deserialize(input: &[u8]) -> Result<Self, InstructionError> {
|
pub fn deserialize(_input: &[u8]) -> Result<Self, InstructionError> {
|
||||||
deserialize::<VoteStateVersions>(input)
|
#[cfg(not(target_os = "solana"))]
|
||||||
.map(|versioned| versioned.convert_to_current())
|
{
|
||||||
.map_err(|_| InstructionError::InvalidAccountData)
|
deserialize::<VoteStateVersions>(_input)
|
||||||
|
.map(|versioned| versioned.convert_to_current())
|
||||||
|
.map_err(|_| InstructionError::InvalidAccountData)
|
||||||
|
}
|
||||||
|
#[cfg(target_os = "solana")]
|
||||||
|
unimplemented!();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn serialize(
|
pub fn serialize(
|
||||||
|
|
Loading…
Reference in New Issue