From 84caaf2c3aaf84e2f6addae4e4e1d33a88fc48c4 Mon Sep 17 00:00:00 2001 From: parazyd Date: Wed, 16 Nov 2022 11:19:30 +0100 Subject: [PATCH] runtime: Add wasm bincode to WasmStore after successful deploy execution. --- src/runtime/vm_runtime.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runtime/vm_runtime.rs b/src/runtime/vm_runtime.rs index b8450ffa0..d6ed5f405 100644 --- a/src/runtime/vm_runtime.rs +++ b/src/runtime/vm_runtime.rs @@ -79,6 +79,8 @@ pub struct Env { pub db_batches: RefCell>, /// The contract ID being executed pub contract_id: ContractId, + /// The compiled wasm bincode being executed, + pub contract_bincode: Vec, /// The contract section being executed pub contract_section: ContractSection, /// State update produced by a smart contract function call @@ -159,6 +161,7 @@ impl Runtime { db_handles, db_batches, contract_id, + contract_bincode: wasm_bytes.to_vec(), contract_section: ContractSection::Null, contract_return_data: Cell::new(None), logs, @@ -329,6 +332,9 @@ impl Runtime { db.flush()?; } + // Update the wasm bincode in the WasmStore + env_mut.blockchain.wasm_bincode.insert(env_mut.contract_id, &env_mut.contract_bincode)?; + Ok(()) }