Fixed bug in AccountInfo::serialize() (#20923)
Closes #20917
(cherry picked from commit edf5bc242c
)
Co-authored-by: Eugene Lomov <eugene.v.lomov@gmail.com>
This commit is contained in:
@ -140,7 +140,7 @@ impl<'a> AccountInfo<'a> {
|
|||||||
bincode::deserialize(&self.data.borrow())
|
bincode::deserialize(&self.data.borrow())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn serialize_data<T: serde::Serialize>(&mut self, state: &T) -> Result<(), bincode::Error> {
|
pub fn serialize_data<T: serde::Serialize>(&self, state: &T) -> Result<(), bincode::Error> {
|
||||||
if bincode::serialized_size(state)? > self.data_len() as u64 {
|
if bincode::serialized_size(state)? > self.data_len() as u64 {
|
||||||
return Err(Box::new(bincode::ErrorKind::SizeLimit));
|
return Err(Box::new(bincode::ErrorKind::SizeLimit));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user