11mod fixtures;
22
33use anyhow:: Result ;
4- use fixtures:: { provider_with_states, DOJO_WORLD_SIERRA_CLASS } ;
54use katana_primitives:: block:: { BlockHashOrNumber , BlockNumber } ;
65use katana_primitives:: class:: { ClassHash , CompiledClassHash , ContractClass } ;
76use katana_provider:: api:: contract:: ContractClassProviderExt ;
87use katana_provider:: api:: state:: { StateFactoryProvider , StateProvider } ;
98use rstest_reuse:: { self , * } ;
109use starknet:: macros:: felt;
1110
11+ use crate :: fixtures:: { db_provider_with_states, DOJO_WORLD_SIERRA_CLASS } ;
12+
1213type ClassHashAndClasses = ( ClassHash , Option < CompiledClassHash > , Option < ContractClass > ) ;
1314
1415fn assert_state_provider_class (
@@ -36,7 +37,6 @@ mod latest {
3637 use katana_provider:: { DbProviderFactory , ProviderFactory } ;
3738
3839 use super :: * ;
39- use crate :: fixtures:: db_provider;
4040
4141 fn assert_latest_class (
4242 provider : impl StateFactoryProvider ,
@@ -55,21 +55,17 @@ mod latest {
5555 ( felt!( "33" ) , Some ( felt!( "3000" ) ) , Some ( ContractClass :: Class ( ( * DOJO_WORLD_SIERRA_CLASS ) . clone( ) ) ) ) ,
5656 ]
5757 ) ]
58- fn test_latest_class_read (
59- #[ from( provider_with_states) ] provider_factory : impl ProviderFactory ,
60- #[ case] expected_class : Vec < ClassHashAndClasses > ,
61- ) {
62- }
58+ fn test_latest_class_read ( #[ case] expected_class : Vec < ClassHashAndClasses > ) { }
6359
6460 mod fork {
65- use fixtures:: fork:: fork_provider_with_spawned_fork_network ;
66- use katana_provider:: { ForkProviderFactory , ProviderFactory } ;
61+ use fixtures:: fork:: fork_provider_with_spawned_fork_network_and_states ;
62+ use katana_provider:: ForkProviderFactory ;
6763
6864 use super :: * ;
6965
7066 #[ apply( test_latest_class_read) ]
7167 fn read_class_from_fork_provider (
72- #[ with ( fork_provider_with_spawned_fork_network :: default ( ) ) ]
68+ #[ from ( fork_provider_with_spawned_fork_network_and_states ) ]
7369 provider_factory : ForkProviderFactory ,
7470 #[ case] expected_classes : Vec < ClassHashAndClasses > ,
7571 ) -> Result < ( ) > {
@@ -80,7 +76,7 @@ mod latest {
8076
8177 #[ apply( test_latest_class_read) ]
8278 fn read_class_from_db_provider (
83- #[ with ( db_provider ( ) ) ] provider_factory : DbProviderFactory ,
79+ #[ from ( db_provider_with_states ) ] provider_factory : DbProviderFactory ,
8480 #[ case] expected_classes : Vec < ClassHashAndClasses > ,
8581 ) -> Result < ( ) > {
8682 let provider = provider_factory. provider ( ) ;
@@ -93,7 +89,6 @@ mod historical {
9389 use katana_provider:: { DbProviderFactory , ProviderFactory } ;
9490
9591 use super :: * ;
96- use crate :: fixtures:: db_provider;
9792
9893 fn assert_historical_class (
9994 provider : impl StateFactoryProvider ,
@@ -143,21 +138,20 @@ mod historical {
143138 ] )
144139 ]
145140 fn test_historical_class_read (
146- #[ from( provider_with_states) ] provider_factory : impl ProviderFactory ,
147141 #[ case] block_num : BlockNumber ,
148142 #[ case] expected_class : Vec < ClassHashAndClasses > ,
149143 ) {
150144 }
151145
152146 mod fork {
153- use fixtures:: fork:: fork_provider_with_spawned_fork_network ;
154- use katana_provider:: { ForkProviderFactory , ProviderFactory } ;
147+ use fixtures:: fork:: fork_provider_with_spawned_fork_network_and_states ;
148+ use katana_provider:: ForkProviderFactory ;
155149
156150 use super :: * ;
157151
158152 #[ apply( test_historical_class_read) ]
159153 fn read_class_from_fork_provider (
160- #[ with ( fork_provider_with_spawned_fork_network :: default ( ) ) ]
154+ #[ from ( fork_provider_with_spawned_fork_network_and_states ) ]
161155 provider_factory : ForkProviderFactory ,
162156 #[ case] block_num : BlockNumber ,
163157 #[ case] expected_classes : Vec < ClassHashAndClasses > ,
@@ -169,7 +163,7 @@ mod historical {
169163
170164 #[ apply( test_historical_class_read) ]
171165 fn read_class_from_db_provider (
172- #[ with ( db_provider ( ) ) ] provider_factory : DbProviderFactory ,
166+ #[ from ( db_provider_with_states ) ] provider_factory : DbProviderFactory ,
173167 #[ case] block_num : BlockNumber ,
174168 #[ case] expected_classes : Vec < ClassHashAndClasses > ,
175169 ) -> Result < ( ) > {
0 commit comments