Use checked math when calculating storage size (#7885)

This commit is contained in:
Alexander Theißen
2021-01-14 13:44:42 +01:00
committed by GitHub
parent 65569620c2
commit c2ebcae0a6
5 changed files with 46 additions and 41 deletions
+5
View File
@@ -421,6 +421,11 @@ decl_error! {
/// This can be returned from [`Module::claim_surcharge`] because the target
/// contract has enough balance to pay for its rent.
ContractNotEvictable,
/// A storage modification exhausted the 32bit type that holds the storage size.
///
/// This can either happen when the accumulated storage in bytes is too large or
/// when number of storage items is too large.
StorageExhausted,
}
}