Skip to content

Commit

Permalink
pow-migration: Fix test compilation
Browse files Browse the repository at this point in the history
Fix compilation of tests in the `pow-migration` subcrate.
This fixes #2680.
  • Loading branch information
jsdanielh authored and hrxi committed Jun 27, 2024
1 parent c740e1d commit 6039349
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions pow-migration/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@ mod pow_migration_test {
block_windows: &BlockWindows,
validator_address: &str,
network_id: NetworkId,
) -> Result<GenesisConfig, Error> {
candidate_block: u32,
) -> Result<Option<GenesisConfig>, Error> {
let env = VolatileDatabase::new(20).unwrap();
let client = setup_pow_client();
let address = Address::from_user_friendly_address(&validator_address)
.expect("Could not parse provided validator address");
migrate(&client, block_windows, env, &address, network_id).await
migrate(
&client,
block_windows,
candidate_block,
env,
&Some(address),
network_id,
)
.await
}

#[test(tokio::test)]
Expand All @@ -44,9 +53,16 @@ mod pow_migration_test {
readiness_window: 10,
};
let network_id = NetworkId::TestAlbatross;
let genesis = test_pow_migration(&block_windows, &validator_address, network_id)
.await
.unwrap();
let candidate_block = 2664100;
let genesis = test_pow_migration(
&block_windows,
&validator_address,
network_id,
candidate_block,
)
.await
.unwrap()
.unwrap();
assert_eq!(genesis.validators.len(), 2);
assert_eq!(genesis.stakers.len(), 2);
assert!(
Expand Down

0 comments on commit 6039349

Please sign in to comment.