33use {
44 mollusk_svm:: { result:: Check , Mollusk } ,
55 mollusk_svm_fuzz_fixture:: Fixture ,
6- solana_sdk:: { account:: AccountSharedData , pubkey:: Pubkey , system_instruction, system_program} ,
6+ solana_sdk:: {
7+ account:: AccountSharedData , feature_set:: FeatureSet , pubkey:: Pubkey , system_instruction,
8+ system_program,
9+ } ,
710 std:: path:: Path ,
811} ;
912
@@ -59,6 +62,14 @@ fn clear() {
5962 }
6063}
6164
65+ fn compare_feature_sets ( from_fixture : & FeatureSet , from_mollusk : & FeatureSet ) {
66+ assert_eq ! ( from_fixture. active. len( ) , from_mollusk. active. len( ) ) ;
67+ assert_eq ! ( from_fixture. inactive. len( ) , from_mollusk. inactive. len( ) ) ;
68+ for f in from_fixture. active . keys ( ) {
69+ assert ! ( from_mollusk. active. contains_key( f) ) ;
70+ }
71+ }
72+
6273#[ test]
6374fn test_dump ( ) {
6475 clear ( ) ;
@@ -100,7 +111,8 @@ fn test_dump() {
100111 let blob_fixture_path = find_fixture ( & FileType :: Blob ) . unwrap ( ) ;
101112 let blob_fixture = Fixture :: load_from_blob_file ( & blob_fixture_path) ;
102113 assert_eq ! ( blob_fixture. input. compute_budget, mollusk. compute_budget) ;
103- assert_eq ! ( blob_fixture. input. feature_set, mollusk. feature_set) ;
114+ // Feature set matches, but it can't guarantee sorting.
115+ compare_feature_sets ( & blob_fixture. input . feature_set , & mollusk. feature_set ) ;
104116 assert_eq ! ( blob_fixture. input. sysvars. clock, mollusk. sysvars. clock) ;
105117 assert_eq ! ( blob_fixture. input. sysvars. rent, mollusk. sysvars. rent) ;
106118 assert_eq ! ( blob_fixture. input. program_id, instruction. program_id) ;
@@ -115,7 +127,8 @@ fn test_dump() {
115127 let json_fixture_path = find_fixture ( & FileType :: Json ) . unwrap ( ) ;
116128 let json_fixture = Fixture :: load_from_json_file ( & json_fixture_path) ;
117129 assert_eq ! ( json_fixture. input. compute_budget, mollusk. compute_budget) ;
118- assert_eq ! ( json_fixture. input. feature_set, mollusk. feature_set) ;
130+ // Feature set matches, but it can't guarantee sorting.
131+ compare_feature_sets ( & json_fixture. input . feature_set , & mollusk. feature_set ) ;
119132 assert_eq ! ( json_fixture. input. sysvars. clock, mollusk. sysvars. clock) ;
120133 assert_eq ! ( json_fixture. input. sysvars. rent, mollusk. sysvars. rent) ;
121134 assert_eq ! ( json_fixture. input. program_id, instruction. program_id) ;
0 commit comments