Skip to content

Commit

Permalink
Rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGCalderon committed Jul 11, 2024
1 parent c82aea4 commit 50d6d3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion replay/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn execute_block_range(block_range_data: &mut Vec<BlockCachedData>) {
&mut transactional_state,
block_context.clone(),
transaction.to_owned(),
transaction_hash.to_owned(),
transaction_hash,
);

match result {
Expand Down
22 changes: 11 additions & 11 deletions rpc-state-reader/src/blockifier_state_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ fn calculate_class_info_for_testing(contract_class: ContractClass) -> ClassInfo
/// needed to execute the transaction.
pub fn execute_tx_with_blockifier(
state: &mut CachedState<impl StateReader>,
context: BlockContext,
transaction: SNTransaction,
transaction_hash: TransactionHash,
block_context: BlockContext,
tx: SNTransaction,
tx_hash: &TransactionHash,
) -> TransactionExecutionResult<TransactionExecutionInfo> {
let account_transaction: AccountTransaction = match transaction {
let blockifier_tx: AccountTransaction = match tx {
SNTransaction::Invoke(tx) => {
let invoke = InvokeTransaction {
tx,
tx_hash: transaction_hash,
tx_hash: *tx_hash,
only_query: false,
};
AccountTransaction::Invoke(invoke)
Expand All @@ -310,7 +310,7 @@ pub fn execute_tx_with_blockifier(
AccountTransaction::DeployAccount(DeployAccountTransaction {
only_query: false,
tx,
tx_hash: transaction_hash,
tx_hash: *tx_hash,
contract_address,
})
}
Expand All @@ -322,23 +322,23 @@ pub fn execute_tx_with_blockifier(

let class_info = calculate_class_info_for_testing(contract_class);

let declare = DeclareTransaction::new(tx, transaction_hash, class_info).unwrap();
let declare = DeclareTransaction::new(tx, *tx_hash, class_info).unwrap();
AccountTransaction::Declare(declare)
}
SNTransaction::L1Handler(tx) => {
// As L1Hanlder is not an account transaction we execute it here and return the result
let account_transaction = L1HandlerTransaction {
tx,
tx_hash: transaction_hash,
tx_hash: *tx_hash,
paid_fee_on_l1: starknet_api::transaction::Fee(u128::MAX),
};

return account_transaction.execute(state, &context, true, true);
return account_transaction.execute(state, &block_context, true, true);
}
_ => unimplemented!(),
};

account_transaction.execute(state, &context, false, true)
blockifier_tx.execute(state, &block_context, false, true)
}

pub fn execute_tx_configurable(
Expand All @@ -356,7 +356,7 @@ pub fn execute_tx_configurable(
TransactionHash(StarkFelt::try_from(tx_hash.strip_prefix("0x").unwrap()).unwrap());
let tx = state.state.0.get_transaction(&tx_hash).unwrap();
let block_context = fetch_block_context(&state.state.0, block_number);
let blockifier_exec_info = execute_tx_with_blockifier(state, block_context, tx, tx_hash)?;
let blockifier_exec_info = execute_tx_with_blockifier(state, block_context, tx, &tx_hash)?;

let trace = state.state.0.get_transaction_trace(&tx_hash).unwrap();
let receipt = state.state.0.get_transaction_receipt(&tx_hash).unwrap();
Expand Down

0 comments on commit 50d6d3f

Please sign in to comment.