Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions aptos-move/aptos-native-interface/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use aptos_gas_algebra::DynamicExpression;
use aptos_gas_schedule::{MiscGasParameters, NativeGasParameters};
use aptos_types::on_chain_config::{Features, TimedFeatures};
use move_vm_runtime::native_functions::{NativeContext, NativeFunction};
use move_vm_types::{
loaded_data::runtime_types::Type, natives::function::NativeResult, values::Value,
};
use move_vm_types::{natives::function::NativeResult, ty_interner::TypeId, values::Value};
use smallvec::SmallVec;
use std::{collections::VecDeque, sync::Arc};

Expand Down Expand Up @@ -81,9 +79,9 @@ impl SafeNativeBuilder {
/// allowing the client to use [`SafeNativeContext`] instead of Move VM's [`NativeContext`].
pub fn make_native<F>(&self, native: F) -> NativeFunction
where
F: Fn(
F: for<'a> Fn(
&mut SafeNativeContext,
Vec<Type>,
&'a [TypeId],
VecDeque<Value>,
) -> SafeNativeResult<SmallVec<[Value; 1]>>
+ Send
Expand All @@ -95,7 +93,7 @@ impl SafeNativeBuilder {

let enable_incremental_gas_charging = self.enable_incremental_gas_charging;

let closure = move |context: &mut NativeContext, ty_args, args| {
let closure = move |context: &mut NativeContext, ty_args: &[TypeId], args| {
use SafeNativeError::*;

let mut context = SafeNativeContext {
Expand Down Expand Up @@ -175,9 +173,9 @@ impl SafeNativeBuilder {
) -> impl Iterator<Item = (String, NativeFunction)> + 'a
where
'b: 'a,
F: Fn(
F: for<'c> Fn(
&mut SafeNativeContext,
Vec<Type>,
&'c [TypeId],
VecDeque<Value>,
) -> SafeNativeResult<SmallVec<[Value; 1]>>
+ Send
Expand Down
4 changes: 2 additions & 2 deletions aptos-move/aptos-native-interface/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use move_binary_format::errors::PartialVMError;
use move_core_types::{identifier::Identifier, language_storage::ModuleId, vm_status::StatusCode};
use move_vm_types::{loaded_data::runtime_types::Type, values::Value};
use move_vm_types::{ty_interner::TypeId, values::Value};
use smallvec::SmallVec;

/// Wraps [PartialVMError] to ensure it cannot be constructed via public constructor when we create
Expand Down Expand Up @@ -81,7 +81,7 @@ pub enum SafeNativeError {
FunctionDispatch {
module_name: ModuleId,
func_name: Identifier,
ty_args: Vec<Type>,
ty_args: Vec<TypeId>,
args: SmallVec<[Value; 1]>,
},

Expand Down
4 changes: 2 additions & 2 deletions aptos-move/aptos-native-interface/src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use crate::{context::SafeNativeContext, errors::SafeNativeResult};
use move_vm_types::{loaded_data::runtime_types::Type, values::Value};
use move_vm_types::{ty_interner::TypeId, values::Value};
use smallvec::SmallVec;
use std::collections::VecDeque;

Expand All @@ -12,6 +12,6 @@ use std::collections::VecDeque;
/// it can be used in the VM.
pub type RawSafeNative = fn(
&mut SafeNativeContext,
Vec<Type>,
&[TypeId],
VecDeque<Value>,
) -> SafeNativeResult<SmallVec<[Value; 1]>>;
6 changes: 3 additions & 3 deletions aptos-move/aptos-vm-profiling/src/bins/run_move.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use move_vm_runtime::{
};
use move_vm_test_utils::InMemoryStorage;
use move_vm_types::{
gas::UnmeteredGasMeter, loaded_data::runtime_types::Type, natives::function::NativeResult,
pop_arg, values::Value,
gas::UnmeteredGasMeter, natives::function::NativeResult, pop_arg, ty_interner::TypeId,
values::Value,
};
use smallvec::smallvec;
use std::{collections::VecDeque, env, fs, sync::Arc};
Expand All @@ -37,7 +37,7 @@ enum Entrypoint {
}

fn make_native_create_signer() -> NativeFunction {
Arc::new(|_context, ty_args: Vec<Type>, mut args: VecDeque<Value>| {
Arc::new(|_context, ty_args: &[TypeId], mut args: VecDeque<Value>| {
assert!(ty_args.is_empty());
assert_eq!(args.len(), 1);

Expand Down
Loading
Loading