Skip to content

Commit

Permalink
re-enable fee time based upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Sep 10, 2024
1 parent 1236342 commit 8cdd0bc
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions sequencer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1490,28 +1490,36 @@ mod test {
test_upgrade_helper::<MySequencerVersions>(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, 1>, 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(
<MySequencerVersions as Versions>::Upgrade::VERSION,
Upgrade { mode, upgrade_type },
);
test_upgrade_helper::<MySequencerVersions>(upgrades, MySequencerVersions::new()).await;
}

#[async_std::test]
async fn test_marketplace_upgrade_view_based() {
Expand Down

0 comments on commit 8cdd0bc

Please sign in to comment.