Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
prajwolrg authored and Prajwol Gyawali committed Feb 6, 2025
1 parent 90e7fd7 commit 5ba172c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions crates/state/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,14 @@ impl BatchTransition {
}
}

/// Creates a [`CheckpointBaseState`] by taking the initial state of the [`BatchTransition`]
/// Creates a [`CheckpointBaseStateCommitment`] by taking the initial state of the
/// [`BatchTransition`]
pub fn get_initial_checkpoint_base_state(&self) -> CheckpointBaseStateCommitment {
CheckpointBaseStateCommitment::new(self.l1_transition.0, self.l2_transition.0)
}

/// Creates a [`CheckpointBaseState`] by taking the final state of the [`BatchTransition`]
/// Creates a [`CheckpointBaseStateCommitment`] by taking the final state of the
/// [`BatchTransition`]
pub fn get_final_checkpoint_base_state(&self) -> CheckpointBaseStateCommitment {
CheckpointBaseStateCommitment::new(self.l1_transition.1, self.l2_transition.1)
}
Expand Down
2 changes: 1 addition & 1 deletion functional-tests/tests/sync/sync_bitcoin_reorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def check_nth_checkpoint_finalized_on_reorg(
btcrpc.proxy.generatetoaddress(finality_depth + 1, new_addr)

batch_info = seqrpc.strata_getCheckpointInfo(checkpt_idx)
to_finalize_blkid = batch_info["l2_blockid"]
to_finalize_blkid = batch_info["l2_range"][1]["blkid"]

# Check finalized
wait_until(
Expand Down
4 changes: 2 additions & 2 deletions functional-tests/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ def check_nth_checkpoint_finalized(
timeout=3,
)

assert syncstat["finalized_block_id"] != batch_info["l2_blockid"], (
assert syncstat["finalized_block_id"] != batch_info["l2_range"][1]["blkid"], (
"Checkpoint block should not yet finalize"
)
assert batch_info["idx"] == idx
checkpoint_info_next = seqrpc.strata_getCheckpointInfo(idx + 1)
assert checkpoint_info_next is None, f"There should be no checkpoint info for {idx + 1} index"

to_finalize_blkid = batch_info["l2_blockid"]
to_finalize_blkid = batch_info["l2_range"][1]["blkid"]

# Submit checkpoint if proof_timeout is not set
if proof_timeout is None:
Expand Down

0 comments on commit 5ba172c

Please sign in to comment.