Skip to content

Commit

Permalink
rollup_context.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
keroro520 committed Nov 6, 2022
1 parent 39b4edc commit 76b0584
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/types/src/offchain/rollup_context.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::core::Timepoint;
use crate::finality::finality_as_blocks;
use crate::packed::{GlobalState, RollupConfig};
use crate::prelude::Unpack;
use sparse_merkle_tree::H256;
Expand Down Expand Up @@ -57,7 +56,7 @@ impl CompatibleFinalizedTimepoint {
},
Timepoint::Timestamp(finalized_timestamp) => {
let global_block_number = global_state.block().count().unpack().saturating_sub(1);
let finality_as_blocks = finality_as_blocks(rollup_config_finality);
let finality_as_blocks = rollup_config_finality;
Self {
finalized_timestamp: Some(finalized_timestamp),
finalized_block_number: global_block_number.saturating_sub(finality_as_blocks),
Expand All @@ -68,7 +67,7 @@ impl CompatibleFinalizedTimepoint {

// Test use only!
pub fn from_block_number(block_number: u64, rollup_config_finality: u64) -> Self {
let finality_as_blocks = finality_as_blocks(rollup_config_finality);
let finality_as_blocks = rollup_config_finality;
Self {
finalized_timestamp: None,
finalized_block_number: block_number.saturating_sub(finality_as_blocks),
Expand Down

0 comments on commit 76b0584

Please sign in to comment.