File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed
Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ impl RollkitClientBuilder {
113113 self
114114 }
115115
116-
117116 /// Build the RollkitClient
118117 pub async fn build ( self ) -> Result < RollkitClient > {
119118 if self . endpoint . is_empty ( ) {
Original file line number Diff line number Diff line change @@ -15,34 +15,34 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1515 ( p. extension ( ) ?. to_str ( ) ? == "proto" ) . then_some ( p)
1616 } )
1717 . collect ( ) ;
18-
18+
1919 // Create output directories
2020 let proto_dir = manifest_dir. join ( "src/proto" ) ;
2121 fs:: create_dir_all ( & proto_dir) ?;
22-
22+
2323 // Always generate both versions and keep them checked in
2424 // This way users don't need to regenerate based on features
25-
25+
2626 // 1. Generate pure message types (no tonic dependencies)
2727 let mut prost_config = prost_build:: Config :: new ( ) ;
2828 prost_config. out_dir ( & proto_dir) ;
2929 // Important: we need to rename the output to avoid conflicts
3030 prost_config. compile_protos ( & proto_files, & [ proto_root. as_path ( ) ] ) ?;
31-
31+
3232 // Rename the generated file to messages.rs
3333 let generated_file = proto_dir. join ( "rollkit.v1.rs" ) ;
3434 let messages_file = proto_dir. join ( "rollkit.v1.messages.rs" ) ;
3535 if generated_file. exists ( ) {
3636 fs:: rename ( & generated_file, & messages_file) ?;
3737 }
38-
38+
3939 // 2. Generate full code with gRPC services (always generate, conditionally include)
4040 tonic_build:: configure ( )
4141 . build_server ( true )
4242 . build_client ( true )
4343 . out_dir ( & proto_dir)
4444 . compile ( & proto_files, & [ proto_root. as_path ( ) ] ) ?;
45-
45+
4646 // Rename to services.rs
4747 let services_file = proto_dir. join ( "rollkit.v1.services.rs" ) ;
4848 if generated_file. exists ( ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ pub mod v1 {
22 // Always include the pure message types (no tonic dependencies)
33 #[ cfg( not( feature = "grpc" ) ) ]
44 include ! ( "proto/rollkit.v1.messages.rs" ) ;
5-
5+
66 // Include the full version with gRPC services when the feature is enabled
77 #[ cfg( feature = "grpc" ) ]
88 include ! ( "proto/rollkit.v1.services.rs" ) ;
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ fn test_grpc_types_available() {
1414 use rollkit_types:: v1:: p2p_service_client:: P2pServiceClient ;
1515 use rollkit_types:: v1:: signer_service_client:: SignerServiceClient ;
1616 use rollkit_types:: v1:: store_service_client:: StoreServiceClient ;
17-
17+
1818 // Just verify the types exist
1919 let _ = std:: any:: type_name :: < HealthServiceClient < tonic:: transport:: Channel > > ( ) ;
2020 let _ = std:: any:: type_name :: < P2pServiceClient < tonic:: transport:: Channel > > ( ) ;
2121 let _ = std:: any:: type_name :: < SignerServiceClient < tonic:: transport:: Channel > > ( ) ;
2222 let _ = std:: any:: type_name :: < StoreServiceClient < tonic:: transport:: Channel > > ( ) ;
23- }
23+ }
You can’t perform that action at this time.
0 commit comments