Skip to content

Commit 2d84cfe

Browse files
committed
Fixes and cleanups
1 parent bbef086 commit 2d84cfe

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

tests/instances/transactions/src/lib.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn test_withdrawal() {
287287

288288
let output = tester.execute_block(transactions);
289289

290-
tester.assert_all_txs_succeded(&output);
290+
tester.assert_all_txs_succeeded(&output);
291291

292292
// Check preimage of withdrawal
293293
let mut expected_preimage =
@@ -346,7 +346,7 @@ fn test_tx_with_access_list() {
346346

347347
let output = tester.execute_block(transactions);
348348

349-
tester.assert_all_txs_succeded(&output);
349+
tester.assert_all_txs_succeeded(&output);
350350
}
351351

352352
#[test]
@@ -396,7 +396,7 @@ fn test_tx_with_authorization_list() {
396396

397397
let output = tester.execute_block(vec![mint_tx]);
398398

399-
tester.assert_all_txs_succeded(&output);
399+
tester.assert_all_txs_succeeded(&output);
400400
}
401401

402402
// Test that slots made warm in a tx are cold in the next tx
@@ -460,7 +460,13 @@ fn test_cold_in_new_tx() {
460460

461461
let output = tester.execute_block(transactions);
462462

463-
tester.assert_all_txs_succeded(&output);
463+
// Assert all txs succeeded
464+
let result0 = output.tx_results.first().unwrap().clone();
465+
let result1 = output.tx_results.get(1).unwrap().clone();
466+
let result2 = output.tx_results.get(2).unwrap().clone();
467+
assert!(result0.is_ok_and(|o| o.is_success()));
468+
assert!(result1.is_ok_and(|o| o.is_success()));
469+
assert!(result2.is_ok_and(|o| !o.is_success()));
464470
}
465471

466472
#[test]
@@ -514,7 +520,7 @@ fn test_independent_txs_have_same_pubdata() {
514520
let output = tester.execute_block(transactions);
515521

516522
// Assert all txs succeeded and compare pubdata len
517-
tester.assert_all_txs_succeded(&output);
523+
tester.assert_all_txs_succeeded(&output);
518524

519525
let result1 = output.tx_results.first().unwrap().clone();
520526
let result2 = output.tx_results.get(1).unwrap().clone();
@@ -616,7 +622,7 @@ fn test_invalid_tx_does_not_affect_native() {
616622
let output = tester.execute_block(transactions);
617623

618624
// Assert tx succeeded
619-
tester.assert_all_txs_succeded(&output);
625+
tester.assert_all_txs_succeeded(&output);
620626

621627
let native_used_reference = output
622628
.tx_results

tests/rig/src/lib.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use alloy::signers::local::PrivateKeySigner;
1515
pub use alloy_rlp;
1616
pub use alloy_sol_types;
1717
pub use basic_bootloader;
18+
use basic_bootloader::bootloader::errors::BootloaderSubsystemError;
1819
pub use basic_system;
1920
pub use callable_oracles;
2021
pub use chain::BlockContext;
@@ -108,6 +109,12 @@ impl ZKsyncOSTester<true> {
108109
}
109110
}
110111

112+
impl Default for ZKsyncOSTester<false> {
113+
fn default() -> Self {
114+
Self::new()
115+
}
116+
}
117+
111118
impl ZKsyncOSTester<false> {
112119
pub fn new() -> Self {
113120
init_logger();
@@ -283,7 +290,7 @@ impl<const RANDOMIZED_TREE: bool> ZKsyncOSTester<RANDOMIZED_TREE> {
283290
self.chain.run_block(
284291
encoded_txs,
285292
self.block_context.clone(),
286-
self.da_commitment_scheme.clone(),
293+
self.da_commitment_scheme,
287294
self.run_config.clone(),
288295
)
289296
}
@@ -300,20 +307,20 @@ impl<const RANDOMIZED_TREE: bool> ZKsyncOSTester<RANDOMIZED_TREE> {
300307
pub fn execute_block_no_panic<T: IntoEncodedTx>(
301308
&mut self,
302309
transactions: Vec<T>,
303-
) -> Result<BlockOutput, basic_bootloader::bootloader::errors::BootloaderSubsystemError> {
310+
) -> Result<BlockOutput, BootloaderSubsystemError> {
304311
let encoded_txs = transactions
305312
.into_iter()
306313
.map(IntoEncodedTx::into_encoded_tx)
307314
.collect::<Vec<_>>();
308315
self.chain.run_block_no_panic(
309316
encoded_txs,
310317
self.block_context.clone(),
311-
self.da_commitment_scheme.clone(),
318+
self.da_commitment_scheme,
312319
self.run_config.clone(),
313320
)
314321
}
315322

316-
pub fn assert_all_txs_succeded(&self, block_output: &BlockOutput) {
323+
pub fn assert_all_txs_succeeded(&self, block_output: &BlockOutput) {
317324
assert!(block_output
318325
.tx_results
319326
.iter()

0 commit comments

Comments
 (0)