Fixed bug in AccountInfo::serialize()

Closes #20917
This commit is contained in:
Eugene Lomov 2021-10-23 19:05:39 +03:00 committed by Michael Vines
parent 89caf65966
commit edf5bc242c
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ impl<'a> AccountInfo<'a> {
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 {
return Err(Box::new(bincode::ErrorKind::SizeLimit));
}