Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Jan 29, 2024
1 parent 2352d69 commit 5255ad7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 5 additions & 3 deletions vm/src/vm_hooks/vh_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
Expand Down
16 changes: 7 additions & 9 deletions vm/src/vm_hooks/vh_handler/vh_blockchain.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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(),
)
}

Expand Down

0 comments on commit 5255ad7

Please sign in to comment.