Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 20bdbf5

Browse files
committed
1 parent 5acd116 commit 20bdbf5

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

language/move-stdlib/src/natives/type_name.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub struct GetGasParameters {
2020
}
2121

2222
fn native_get(
23+
use_original_id: bool,
2324
gas_params: &GetGasParameters,
2425
context: &mut NativeContext,
2526
ty_args: Vec<Type>,
@@ -42,8 +43,10 @@ fn native_get(
4243
Ok(NativeResult::ok(cost, smallvec![type_name_val]))
4344
}
4445

45-
pub fn make_native_get(gas_params: GetGasParameters) -> NativeFunction {
46-
Arc::new(move |context, ty_args, args| native_get(&gas_params, context, ty_args, args))
46+
pub fn make_native_get(use_original_id: bool, gas_params: GetGasParameters) -> NativeFunction {
47+
Arc::new(move |context, ty_args, args| {
48+
native_get(use_original_id, &gas_params, context, ty_args, args)
49+
})
4750
}
4851

4952
#[derive(Debug, Clone)]
@@ -52,7 +55,16 @@ pub struct GasParameters {
5255
}
5356

5457
pub fn make_all(gas_params: GasParameters) -> impl Iterator<Item = (String, NativeFunction)> {
55-
let natives = [("get", make_native_get(gas_params.get))];
58+
let natives = [
59+
(
60+
"get",
61+
make_native_get(/* use_original_id */ false, gas_params.get.clone()),
62+
),
63+
(
64+
"get_with_original_ids",
65+
make_native_get(/* use_original_id */ true, gas_params.get),
66+
),
67+
];
5668

5769
crate::natives::helpers::make_module_natives(natives)
5870
}

0 commit comments

Comments
 (0)