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:
mergify[bot]
2021-10-25 02:26:18 +00:00
committed by GitHub
parent 026385effd
commit 307cda52ac

View File

@ -140,7 +140,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));
}