Skip to content

Commit 6e4a610

Browse files
Merge pull request #5344 from darthsiroftardis/wasm-indirection
[VM2] Write bytecode indirection for vm2 contracts in upgrade
2 parents c778e75 + 9d0b8c3 commit 6e4a610

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

executor/wasm_host/src/host.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,16 @@ pub fn casper_upgrade<S: GlobalStateReader + 'static>(
17961796
code.clone().into(),
17971797
)),
17981798
)?;
1799+
let contract_wasm_key = Key::Hash(new_byte_code_hash);
1800+
let byte_code_key_as_cl_value = match CLValue::from_t(bytecode_key) {
1801+
Ok(cl_value) => cl_value,
1802+
Err(_) => return Ok(HOST_ERROR_CL_VALUE),
1803+
};
1804+
metered_write(
1805+
&mut caller,
1806+
contract_wasm_key,
1807+
StoredValue::CLValue(byte_code_key_as_cl_value),
1808+
)?;
17991809

18001810
let entity = Contract::new(
18011811
package_hash,

0 commit comments

Comments
 (0)