Skip to content

Commit

Permalink
remove prev-tx-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
fbsobreira committed Jun 8, 2024
1 parent d66cd0c commit d8dbf32
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 19 deletions.
1 change: 0 additions & 1 deletion c-api/libvmexeccapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ typedef struct {
void (*delete_from_return_data_func_ptr)(void *context, int32_t result_id);
void (*get_original_tx_hash_func_ptr)(void *context, int32_t data_offset);
void (*get_current_tx_hash_func_ptr)(void *context, int32_t data_offset);
void (*get_prev_tx_hash_func_ptr)(void *context, int32_t data_offset);
void (*managed_sc_address_func_ptr)(void *context, int32_t destination_handle);
void (*managed_owner_address_func_ptr)(void *context, int32_t destination_handle);
void (*managed_caller_func_ptr)(void *context, int32_t destination_handle);
Expand Down
1 change: 0 additions & 1 deletion c-api/src/capi_vm_hook_pointers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub struct vm_exec_vm_hook_c_func_pointers {
pub delete_from_return_data_func_ptr: extern "C" fn(context: *mut c_void, result_id: i32),
pub get_original_tx_hash_func_ptr: extern "C" fn(context: *mut c_void, data_offset: i32),
pub get_current_tx_hash_func_ptr: extern "C" fn(context: *mut c_void, data_offset: i32),
pub get_prev_tx_hash_func_ptr: extern "C" fn(context: *mut c_void, data_offset: i32),
pub managed_sc_address_func_ptr: extern "C" fn(context: *mut c_void, destination_handle: i32),
pub managed_owner_address_func_ptr: extern "C" fn(context: *mut c_void, destination_handle: i32),
pub managed_caller_func_ptr: extern "C" fn(context: *mut c_void, destination_handle: i32),
Expand Down
4 changes: 0 additions & 4 deletions c-api/src/capi_vm_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,6 @@ impl klever_chain_vm_executor::VMHooks for CapiVMHooks {
(self.c_func_pointers_ptr.get_current_tx_hash_func_ptr)(self.vm_hooks_ptr, self.convert_mem_ptr(data_offset))
}

fn get_prev_tx_hash(&self, data_offset: MemPtr) {
(self.c_func_pointers_ptr.get_prev_tx_hash_func_ptr)(self.vm_hooks_ptr, self.convert_mem_ptr(data_offset))
}

fn managed_sc_address(&self, destination_handle: i32) {
(self.c_func_pointers_ptr.managed_sc_address_func_ptr)(self.vm_hooks_ptr, destination_handle)
}
Expand Down
4 changes: 2 additions & 2 deletions vm-executor-wasmer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "klever-chain-vm-executor-wasmer"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
publish = false # will also be published, but it is not yet ready for that

[lib]

[dependencies.klever-chain-vm-executor]
version = "0.2.1"
version = "0.2.2"
path = "../vm-executor"

[dependencies]
Expand Down
6 changes: 0 additions & 6 deletions vm-executor-wasmer/src/wasmer_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,6 @@ fn wasmer_import_get_current_tx_hash(env: &VMHooksWrapper, data_offset: i32) {
env.vm_hooks.get_current_tx_hash(env.convert_mem_ptr(data_offset))
}

#[rustfmt::skip]
fn wasmer_import_get_prev_tx_hash(env: &VMHooksWrapper, data_offset: i32) {
env.vm_hooks.get_prev_tx_hash(env.convert_mem_ptr(data_offset))
}

#[rustfmt::skip]
fn wasmer_import_managed_sc_address(env: &VMHooksWrapper, destination_handle: i32) {
env.vm_hooks.managed_sc_address(destination_handle)
Expand Down Expand Up @@ -1286,7 +1281,6 @@ pub fn generate_import_object(store: &Store, env: &VMHooksWrapper) -> ImportObje
"deleteFromReturnData" => Function::new_native_with_env(store, env.clone(), wasmer_import_delete_from_return_data),
"getOriginalTxHash" => Function::new_native_with_env(store, env.clone(), wasmer_import_get_original_tx_hash),
"getCurrentTxHash" => Function::new_native_with_env(store, env.clone(), wasmer_import_get_current_tx_hash),
"getPrevTxHash" => Function::new_native_with_env(store, env.clone(), wasmer_import_get_prev_tx_hash),
"managedSCAddress" => Function::new_native_with_env(store, env.clone(), wasmer_import_managed_sc_address),
"managedOwnerAddress" => Function::new_native_with_env(store, env.clone(), wasmer_import_managed_owner_address),
"managedCaller" => Function::new_native_with_env(store, env.clone(), wasmer_import_managed_caller),
Expand Down
5 changes: 0 additions & 5 deletions vm-executor/src/vm_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ pub trait VMHooks: core::fmt::Debug + 'static {
fn delete_from_return_data(&self, result_id: i32);
fn get_original_tx_hash(&self, data_offset: MemPtr);
fn get_current_tx_hash(&self, data_offset: MemPtr);
fn get_prev_tx_hash(&self, data_offset: MemPtr);
fn managed_sc_address(&self, destination_handle: i32);
fn managed_owner_address(&self, destination_handle: i32);
fn managed_caller(&self, destination_handle: i32);
Expand Down Expand Up @@ -587,10 +586,6 @@ impl VMHooks for VMHooksDefault {
println!("Called: get_current_tx_hash");
}

fn get_prev_tx_hash(&self, data_offset: MemPtr) {
println!("Called: get_prev_tx_hash");
}

fn managed_sc_address(&self, destination_handle: i32) {
println!("Called: managed_sc_address");
}
Expand Down

0 comments on commit d8dbf32

Please sign in to comment.