Skip to content

Commit

Permalink
fixes test, invert min max typo
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderian committed Dec 4, 2024
1 parent 35152fa commit 383043e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pallets/rolldown/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1521,8 +1521,8 @@ impl<T: Config> Pallet<T> {
update_hash: update.abi_encode_hash(),
update_size: update.pendingDeposits.len() as u128 +
update.pendingCancelResolutions.len() as u128,
max_id: lowest_id,
min_id: last_id,
min_id: lowest_id,
max_id: last_id,
})
}

Expand Down
10 changes: 6 additions & 4 deletions pallets/rolldown/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,10 @@ fn reject_update_with_invalid_too_high_request_id() {

#[test]
#[serial]
fn reject_update_without_new_updates() {
// changed to accept
// seq gets the rights BEFORE LastProcessedRequestOnL2 is updated
// a single request would be duplicated, extrinsic fail and break seq
fn accept_update_without_new_updates() {
ExtBuilder::new().execute_with_default_mocks(|| {
forward_to_block::<Test>(10);

Expand All @@ -1044,9 +1047,8 @@ fn reject_update_without_new_updates() {
forward_to_block::<Test>(16);
assert_eq!(LastProcessedRequestOnL2::<Test>::get(consts::CHAIN), 1u128.into());

assert_err!(
Rolldown::update_l2_from_l1_unsafe(RuntimeOrigin::signed(ALICE), deposit_update),
Error::<Test>::WrongRequestId
assert_ok!(
Rolldown::update_l2_from_l1_unsafe(RuntimeOrigin::signed(ALICE), deposit_update)
);
});
}
Expand Down

0 comments on commit 383043e

Please sign in to comment.