Skip to content

Commit

Permalink
refactor(rooch-framework-tests): simplify execute_as_result
Browse files Browse the repository at this point in the history
Remove unnecessary mutable variable and tx_hash caching in `execute_as_result`. This improves code clarity and reduces redundancy.
  • Loading branch information
popcnt1 committed Feb 3, 2025
1 parent b9dc885 commit dd2b21f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/rooch-framework-tests/src/binding_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,7 @@ impl RustBindingTest {
self.execute_verified_tx(verified_tx)
}

pub fn execute_as_result(
&mut self,
mut tx: RoochTransaction,
) -> Result<ExecuteTransactionResult> {
let _ = tx.tx_hash(); // cache tx_hash
pub fn execute_as_result(&mut self, tx: RoochTransaction) -> Result<ExecuteTransactionResult> {
let verified_tx = self.executor.validate_l2_tx(tx)?;
self.execute_verified_tx_as_result(verified_tx)
}
Expand Down

0 comments on commit dd2b21f

Please sign in to comment.