mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-13 08:05:50 +00:00
Contract storage limit (#3126)
* srml-contracts: Remove hard-coded code hashes from tests. This makes it easier to update existing and add new test Wasm modules. * Test maximum contract storage write size. * Implement storage value limit for contracts. * Bump node runtime spec version.
This commit is contained in:
committed by
Sergei Pepyakin
parent
95061beb79
commit
768eb1af4d
@@ -215,8 +215,11 @@ mod tests {
|
||||
fn get_storage(&self, key: &StorageKey) -> Option<Vec<u8>> {
|
||||
self.storage.get(key).cloned()
|
||||
}
|
||||
fn set_storage(&mut self, key: StorageKey, value: Option<Vec<u8>>) {
|
||||
fn set_storage(&mut self, key: StorageKey, value: Option<Vec<u8>>)
|
||||
-> Result<(), &'static str>
|
||||
{
|
||||
*self.storage.entry(key).or_insert(Vec::new()) = value.unwrap_or(Vec::new());
|
||||
Ok(())
|
||||
}
|
||||
fn instantiate(
|
||||
&mut self,
|
||||
@@ -293,6 +296,8 @@ mod tests {
|
||||
}
|
||||
|
||||
fn block_number(&self) -> u64 { 121 }
|
||||
|
||||
fn max_value_size(&self) -> u32 { 16_384 }
|
||||
}
|
||||
|
||||
fn execute<E: Ext>(
|
||||
|
||||
Reference in New Issue
Block a user