@@ -4,73 +4,66 @@ use crate::{config::*, test_helpers::TEST_DATA_REVIVE};
44use foundry_test_utils:: Filter ;
55use revive_strategy:: ReviveRuntimeMode ;
66use revm:: primitives:: hardfork:: SpecId ;
7+ use rstest:: rstest;
78
9+ #[ rstest]
10+ #[ case:: pvm( ReviveRuntimeMode :: Pvm ) ]
11+ #[ case:: evm( ReviveRuntimeMode :: Evm ) ]
812#[ tokio:: test( flavor = "multi_thread" ) ]
9- async fn test_revive_balance_migration ( ) {
10- let runtime_mode = ReviveRuntimeMode :: Pvm ;
13+ async fn test_revive_balance_migration ( #[ case] runtime_mode : ReviveRuntimeMode ) {
1114 let runner = TEST_DATA_REVIVE . runner_revive ( runtime_mode) ;
1215 let filter = Filter :: new ( "testBalanceMigration" , "EvmReviveMigrationTest" , ".*/revive/.*" ) ;
1316 TestConfig :: with_filter ( runner, filter) . spec_id ( SpecId :: SHANGHAI ) . run ( ) . await ;
1417}
1518
19+ #[ rstest]
20+ #[ case:: pvm( ReviveRuntimeMode :: Pvm ) ]
21+ #[ case:: evm( ReviveRuntimeMode :: Evm ) ]
1622#[ tokio:: test( flavor = "multi_thread" ) ]
17- async fn test_revive_nonce_migration ( ) {
18- let runtime_mode = ReviveRuntimeMode :: Pvm ;
23+ async fn test_revive_nonce_migration ( #[ case] runtime_mode : ReviveRuntimeMode ) {
1924 let runner = TEST_DATA_REVIVE . runner_revive ( runtime_mode) ;
2025 let filter = Filter :: new ( "testNonceMigration" , "EvmReviveMigrationTest" , ".*/revive/.*" ) ;
2126 TestConfig :: with_filter ( runner, filter) . spec_id ( SpecId :: SHANGHAI ) . run ( ) . await ;
2227}
2328
24- // Enable it after new pallet-revive is being used
25- // #[tokio::test(flavor = "multi_thread")]
26- // async fn test_revive_precision_preservation() {
27- // let runtime_mode = ReviveRuntimeMode::Pvm;
28- // let runner = TEST_DATA_REVIVE.runner_revive(runtime_mode);
29- // let filter = Filter::new("testPrecisionPreservation", "EvmReviveMigrationTest",
30- // ".*/revive/.*"); TestConfig::with_filter(runner,
31- // filter).spec_id(SpecId::SHANGHAI).run().await; }
32-
33- #[ tokio:: test( flavor = "multi_thread" ) ]
34- async fn test_revive_pvm_bytecode_migration ( ) {
35- let runtime_mode = ReviveRuntimeMode :: Pvm ;
36- let runner = TEST_DATA_REVIVE . runner_revive ( runtime_mode) ;
37- let filter =
38- Filter :: new ( "testBytecodeMigrationToEvm" , "EvmReviveMigrationTest" , ".*/revive/.*" ) ;
39- TestConfig :: with_filter ( runner, filter) . spec_id ( SpecId :: SHANGHAI ) . run ( ) . await ;
40- }
41-
29+ #[ rstest]
30+ #[ case:: pvm( ReviveRuntimeMode :: Pvm ) ]
31+ #[ case:: evm( ReviveRuntimeMode :: Evm ) ]
4232#[ tokio:: test( flavor = "multi_thread" ) ]
43- async fn test_revive_evm_bytecode_migration ( ) {
44- let runtime_mode = ReviveRuntimeMode :: Evm ;
33+ async fn test_revive_bytecode_migration ( #[ case] runtime_mode : ReviveRuntimeMode ) {
4534 let runner = TEST_DATA_REVIVE . runner_revive ( runtime_mode) ;
4635 let filter =
4736 Filter :: new ( "testBytecodeMigrationToEvm" , "EvmReviveMigrationTest" , ".*/revive/.*" ) ;
4837 TestConfig :: with_filter ( runner, filter) . spec_id ( SpecId :: SHANGHAI ) . run ( ) . await ;
4938}
5039
40+ #[ rstest]
41+ #[ case:: pvm( ReviveRuntimeMode :: Pvm ) ]
42+ // TODO: Add Evm test when pallet-revive will allow for Evm bytecode upload
5143#[ tokio:: test( flavor = "multi_thread" ) ]
52- async fn test_evm_to_revive_pvm_bytecode_migration ( ) {
53- let runtime_mode = ReviveRuntimeMode :: Pvm ;
44+ async fn test_revive_bytecode_migration_to_revive ( #[ case] runtime_mode : ReviveRuntimeMode ) {
5445 let runner = TEST_DATA_REVIVE . runner_revive ( runtime_mode) ;
5546 let filter =
5647 Filter :: new ( "testBytecodeMigrationToRevive" , "EvmReviveMigrationTest" , ".*/revive/.*" ) ;
5748 TestConfig :: with_filter ( runner, filter) . spec_id ( SpecId :: SHANGHAI ) . run ( ) . await ;
5849}
5950
60- // TODO: Enable when pallet-revive's EVM mode supports uploading EVM bytecode
61- // Currently getting CodeRejected errors even though pallet-revive uses REVM
51+ // Enable it after new pallet-revive is being used
52+ // #[rstest]
53+ // #[case::pvm(ReviveRuntimeMode::Pvm)]
54+ // #[case::evm(ReviveRuntimeMode::Evm)]
6255// #[tokio::test(flavor = "multi_thread")]
63- // async fn test_evm_to_revive_evm_bytecode_migration() {
64- // let runtime_mode = ReviveRuntimeMode::Evm;
56+ // async fn test_revive_precision_preservation(#[case] runtime_mode: ReviveRuntimeMode) {
6557// let runner = TEST_DATA_REVIVE.runner_revive(runtime_mode);
66- // let filter =
67- // Filter::new("testBytecodeMigrationToRevive", "EvmReviveMigrationTest", ".*/revive/.*");
68- // TestConfig::with_filter(runner, filter).spec_id(SpecId::SHANGHAI).run().await;
69- // }
58+ // let filter = Filter::new("testPrecisionPreservation", "EvmReviveMigrationTest",
59+ // ".*/revive/.*"); TestConfig::with_filter(runner,
60+ // filter).spec_id(SpecId::SHANGHAI).run().await; }
7061
62+ // #[rstest]
63+ // #[case::pvm(ReviveRuntimeMode::Pvm)]
64+ // #[case::evm(ReviveRuntimeMode::Evm)]
7165// #[tokio::test(flavor = "multi_thread")]
72- // async fn test_revive_timestamp_migration() {
73- // let runtime_mode = ReviveRuntimeMode::Pvm;
66+ // async fn test_revive_timestamp_migration(#[case] runtime_mode: ReviveRuntimeMode) {
7467// let runner = TEST_DATA_REVIVE.runner_revive(runtime_mode);
7568// let filter = Filter::new("testTimestampMigration", "EvmReviveMigrationTest", ".*/revive/.*");
7669// TestConfig::with_filter(runner, filter).spec_id(SpecId::SHANGHAI).run().await;
0 commit comments