File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
iota-execution/latest/iota-move-natives/src Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use crate::{NativesCostTable, raw_module_loader::RawModuleLoader};
2222
2323#[ derive( Copy , Clone , Debug ) ]
2424pub struct CreateAuthInfoV1ImplCostParams {
25- pub create_auth_info_v1_cost_base : InternalGas ,
25+ pub create_auth_info_v1_cost_base : Option < InternalGas > ,
2626}
2727
2828pub fn create_auth_info_v1_impl (
@@ -38,10 +38,15 @@ pub fn create_auth_info_v1_impl(
3838 . extensions_mut ( )
3939 . get :: < NativesCostTable > ( )
4040 . account_create_auth_info_v1_impl_params ;
41- native_charge_gas_early_exit ! (
42- context,
43- account_create_auth_info_v1_impl_params. create_auth_info_v1_cost_base
44- ) ;
41+
42+ let create_auth_info_v1_cost_base = account_create_auth_info_v1_impl_params
43+ . create_auth_info_v1_cost_base
44+ . ok_or_else ( || {
45+ PartialVMError :: new ( StatusCode :: UNKNOWN_INVARIANT_VIOLATION_ERROR )
46+ . with_message ( "gas cost is not set" . to_string ( ) )
47+ } ) ?;
48+
49+ native_charge_gas_early_exit ! ( context, create_auth_info_v1_cost_base) ;
4550
4651 let function_name_bytes = pop_arg ! ( args, VectorRef ) ;
4752 let function_name = String :: from ( unsafe {
Original file line number Diff line number Diff line change @@ -192,8 +192,8 @@ impl NativesCostTable {
192192 // account
193193 account_create_auth_info_v1_impl_params : CreateAuthInfoV1ImplCostParams {
194194 create_auth_info_v1_cost_base : protocol_config
195- . create_auth_info_v1_cost_base ( )
196- . into ( ) ,
195+ . create_auth_info_v1_cost_base_as_option ( )
196+ . map ( Into :: into ) ,
197197 } ,
198198 // address
199199 address_from_bytes_cost_params : AddressFromBytesCostParams {
You can’t perform that action at this time.
0 commit comments