Skip to content

Commit

Permalink
reorder and use make_prod_gas_meter
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 committed May 23, 2024
1 parent 5b65b64 commit 8301498
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions aptos-move/e2e-tests/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1156,15 +1156,6 @@ impl FakeExecutor {
gas_feature_version,
) = get_gas_parameters(&features, state_view);

let gas_params = gas_params_res.unwrap();
let mut gas_meter = make_prod_gas_meter(
gas_feature_version,
gas_params.clone().vm,
storage_gas_params.unwrap(),
false,
10000000000000.into(),
);

let timed_features = TimedFeaturesBuilder::enable_all()
.with_override_profile(TimedFeatureOverride::Testing)
.build();
Expand Down Expand Up @@ -1192,20 +1183,21 @@ impl FakeExecutor {
)?;
let storage = TraversalStorage::new();
if gas_params_res.is_ok() && storage_gas_params.is_ok() {
let gas_params = gas_params_res.unwrap();
let mut gas_meter = make_prod_gas_meter(
gas_feature_version,
gas_params.clone().vm,
storage_gas_params.unwrap(),
false,
100_000_000.into(),
);
session
.execute_entry_function(
entry_fn.module(),
entry_fn.function(),
entry_fn.ty_args().to_vec(),
args,
&mut MemoryTrackedGasMeter::new(StandardGasMeter::new(
StandardGasAlgebra::new(
gas_feature_version,
gas_params_res.unwrap().clone().vm,
storage_gas_params.unwrap(),
100000000,
),
)),
&mut gas_meter,
&mut TraversalContext::new(&storage),
)
.map_err(|e| e.into_vm_status())?;
Expand Down

0 comments on commit 8301498

Please sign in to comment.