From 5255ad7c72bb026d9bfc4fdfcf2402fed7e204f6 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Mon, 29 Jan 2024 13:24:04 +0200 Subject: [PATCH] cleanup --- vm/src/vm_hooks/vh_dispatcher.rs | 8 +++++--- vm/src/vm_hooks/vh_handler/vh_blockchain.rs | 16 +++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vm/src/vm_hooks/vh_dispatcher.rs b/vm/src/vm_hooks/vh_dispatcher.rs index cedcf7870a..0dbfc54051 100644 --- a/vm/src/vm_hooks/vh_dispatcher.rs +++ b/vm/src/vm_hooks/vh_dispatcher.rs @@ -18,7 +18,7 @@ impl VMHooksDispatcher { } } -pub fn bool_to_i32(b: bool) -> i32 { +fn bool_to_i32(b: bool) -> i32 { if b { 1 } else { @@ -944,8 +944,10 @@ impl VMHooks for VMHooksDispatcher { } fn managed_is_builtin_function(&self, function_name_handle: i32) -> i32 { - self.handler - .managed_is_builtin_function(function_name_handle) + bool_to_i32( + self.handler + .managed_is_builtin_function(function_name_handle), + ) } fn big_float_new_from_parts( diff --git a/vm/src/vm_hooks/vh_handler/vh_blockchain.rs b/vm/src/vm_hooks/vh_handler/vh_blockchain.rs index fad5a84952..88d8f1b69c 100644 --- a/vm/src/vm_hooks/vh_handler/vh_blockchain.rs +++ b/vm/src/vm_hooks/vh_handler/vh_blockchain.rs @@ -1,7 +1,7 @@ use crate::{ tx_execution::vm_builtin_function_names::*, types::{EsdtLocalRole, EsdtLocalRoleFlags, RawHandle, VMAddress}, - vm_hooks::{vh_dispatcher::bool_to_i32, VMHooksHandlerSource}, + vm_hooks::VMHooksHandlerSource, world_mock::{EsdtData, EsdtInstance}, }; use num_bigint::BigInt; @@ -170,14 +170,12 @@ pub trait VMHooksBlockchain: VMHooksHandlerSource { .mb_set(response_handle, code_metadata_bytes.to_vec()) } - fn managed_is_builtin_function(&self, function_name_handle: i32) -> i32 { - bool_to_i32( - VM_BUILTIN_FUNCTIONS.contains( - &self - .m_types_lock() - .mb_to_function_name(function_name_handle) - .as_str(), - ), + fn managed_is_builtin_function(&self, function_name_handle: i32) -> bool { + VM_BUILTIN_FUNCTIONS.contains( + &self + .m_types_lock() + .mb_to_function_name(function_name_handle) + .as_str(), ) }