Contracts add code_len to ContractsInfo (#14523)

* add code_len to v12

* fix

* Update frame/contracts/src/wasm/mod.rs

* fix

* fixes

* rm test

* add test back

* fix

* update test

* Fix comments

* fix build

* del

* fix clippy

* fix

* re-rename
This commit is contained in:
PG Herveou
2023-07-14 14:49:47 +02:00
committed by GitHub
parent 70694b903a
commit e8a9559696
5 changed files with 54 additions and 24 deletions
@@ -80,6 +80,7 @@ pub struct CodeInfo<T: Config> {
#[codec(compact)]
refcount: u64,
determinism: Determinism,
code_len: u32,
}
#[storage_alias]
@@ -177,6 +178,7 @@ impl<T: Config> MigrationStep for Migration<T> {
owner: old_info.owner,
deposit,
refcount: old_info.refcount,
code_len: code_len as u32,
};
let amount = old_info.deposit.saturating_sub(info.deposit);
@@ -221,6 +223,7 @@ impl<T: Config> MigrationStep for Migration<T> {
deposit: v.deposit,
refcount: v.refcount,
owner: v.owner,
code_len: module.code.len() as u32,
};
(k, info)
})