From 8cdd0bc200d2dc01282297ed678f80512a4c07d0 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 10 Sep 2024 15:39:26 -0600 Subject: [PATCH] re-enable fee time based upgrade test --- sequencer/src/api.rs | 52 +++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index 24c8c9e5c..781df247c 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -1490,28 +1490,36 @@ mod test { test_upgrade_helper::(upgrades, MySequencerVersions::new()).await; } - // #[async_std::test] - // async fn test_fee_upgrade_time_based() { - // setup_test(); - - // let now = OffsetDateTime::now_utc().unix_timestamp() as u64; - // test_upgrade_helper( - // UpgradeMode::Time(TimeBasedUpgrade { - // start_proposing_time: Timestamp::from_integer(now).unwrap(), - // stop_proposing_time: Timestamp::from_integer(now + 500).unwrap(), - // start_voting_time: None, - // stop_voting_time: None, - // }), - // UpgradeType::Fee { - // chain_config: ChainConfig { - // max_block_size: 300.into(), - // base_fee: 1.into(), - // ..Default::default() - // }, - // }, - // ) - // .await; - // } + #[async_std::test] + async fn test_fee_upgrade_time_based() { + setup_test(); + + let now = OffsetDateTime::now_utc().unix_timestamp() as u64; + + let mut upgrades = std::collections::BTreeMap::new(); + type MySequencerVersions = SequencerVersions, StaticVersion<0, 2>>; + + let mode = UpgradeMode::Time(TimeBasedUpgrade { + start_proposing_time: Timestamp::from_integer(now).unwrap(), + stop_proposing_time: Timestamp::from_integer(now + 500).unwrap(), + start_voting_time: None, + stop_voting_time: None, + }); + + let upgrade_type = UpgradeType::Fee { + chain_config: ChainConfig { + max_block_size: 300.into(), + base_fee: 1.into(), + ..Default::default() + }, + }; + + upgrades.insert( + ::Upgrade::VERSION, + Upgrade { mode, upgrade_type }, + ); + test_upgrade_helper::(upgrades, MySequencerVersions::new()).await; + } #[async_std::test] async fn test_marketplace_upgrade_view_based() {