Skip to content

Commit

Permalink
chore: rename EntryPointExecutionContext::new_invoke to new_execute
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelabro committed Aug 20, 2024
1 parent a57ad02 commit 1f17cc0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/entry_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl EntryPointExecutionContext {
Self::new(tx_context, ExecutionMode::Validate, limit_steps_by_resources)
}

pub fn new_invoke(
pub fn new_execute(
tx_context: Arc<TransactionContext>,
limit_steps_by_resources: bool,
) -> TransactionExecutionResult<Self> {
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/test_utils/struct_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl CallEntryPoint {
let tx_context =
TransactionContext { block_context: BlockContext::create_for_testing(), tx_info };
let mut context =
EntryPointExecutionContext::new_invoke(Arc::new(tx_context), limit_steps_by_resources)
EntryPointExecutionContext::new_execute(Arc::new(tx_context), limit_steps_by_resources)
.unwrap();
self.execute(state, &mut ExecutionResources::default(), &mut context)
}
Expand Down
6 changes: 3 additions & 3 deletions crates/blockifier/src/transaction/account_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl AccountTransaction {
initial_gas: block_context.versioned_constants.os_constants.gas_costs.initial_gas_cost,
};

let mut context = EntryPointExecutionContext::new_invoke(tx_context, true)?;
let mut context = EntryPointExecutionContext::new_execute(tx_context, true)?;

Ok(fee_transfer_call
.execute(state, &mut ExecutionResources::default(), &mut context)
Expand Down Expand Up @@ -455,7 +455,7 @@ impl AccountTransaction {
)?;
} else {
let mut execution_context =
EntryPointExecutionContext::new_invoke(tx_context.clone(), charge_fee)?;
EntryPointExecutionContext::new_execute(tx_context.clone(), charge_fee)?;
validate_call_info = self.handle_validate_tx(
state,
&mut resources,
Expand Down Expand Up @@ -499,7 +499,7 @@ impl AccountTransaction {
) -> TransactionExecutionResult<ValidateExecuteCallInfo> {
let mut resources = ExecutionResources::default();
let mut execution_context =
EntryPointExecutionContext::new_invoke(tx_context.clone(), charge_fee)?;
EntryPointExecutionContext::new_execute(tx_context.clone(), charge_fee)?;
// Run the validation, and if execution later fails, only keep the validation diff.
let validate_call_info = self.handle_validate_tx(
state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ fn test_max_fee_to_max_steps_conversion(
nonce: nonce_manager.next(account_address),
});
let tx_context1 = Arc::new(block_context.to_tx_context(&account_tx1));
let execution_context1 = EntryPointExecutionContext::new_invoke(tx_context1, true).unwrap();
let execution_context1 = EntryPointExecutionContext::new_execute(tx_context1, true).unwrap();
let max_steps_limit1 = execution_context1.vm_run_resources.get_n_steps();
let tx_execution_info1 = account_tx1.execute(&mut state, &block_context, true, true).unwrap();
let n_steps1 = tx_execution_info1.receipt.resources.vm_resources.n_steps;
Expand All @@ -950,7 +950,7 @@ fn test_max_fee_to_max_steps_conversion(
nonce: nonce_manager.next(account_address),
});
let tx_context2 = Arc::new(block_context.to_tx_context(&account_tx2));
let execution_context2 = EntryPointExecutionContext::new_invoke(tx_context2, true).unwrap();
let execution_context2 = EntryPointExecutionContext::new_execute(tx_context2, true).unwrap();
let max_steps_limit2 = execution_context2.vm_run_resources.get_n_steps();
let tx_execution_info2 = account_tx2.execute(&mut state, &block_context, true, true).unwrap();
let n_steps2 = tx_execution_info2.receipt.resources.vm_resources.n_steps;
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/transaction/transaction_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<U: UpdatableState> ExecutableTransaction<U> for L1HandlerTransaction {
let tx_context = Arc::new(block_context.to_tx_context(self));

let mut execution_resources = ExecutionResources::default();
let mut context = EntryPointExecutionContext::new_invoke(tx_context.clone(), true)?;
let mut context = EntryPointExecutionContext::new_execute(tx_context.clone(), true)?;
let mut remaining_gas = block_context.versioned_constants.tx_initial_gas();
let execute_call_info =
self.run_execute(state, &mut execution_resources, &mut context, &mut remaining_gas)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/papyrus_execution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ pub fn execute_call(
override_kzg_da_to_false,
)?;

let mut context = EntryPointExecutionContext::new_invoke(
let mut context = EntryPointExecutionContext::new_execute(
// TODO(yair): fix when supporting v3 transactions
Arc::new(TransactionContext {
block_context,
Expand Down

0 comments on commit 1f17cc0

Please sign in to comment.