Use checked math when calculating storage size (#7885)

This commit is contained in:
Alexander Theißen authored and GitHub committed 2021-01-14 12:44:42 +00:00
1 parent 65569620c2
commit c2ebcae0a6
5 files changed
+46 -41

No files matched your search

+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,
}
}