File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11use std:: io:: Result ;
22
3+ /// Automatically runs during cargo build.
4+ /// Proto files for Lazer are defined in the lazer sdk folder in the proto/ subdirectory.
5+ /// Both JS and Rust SDKs read the proto files for generating types.
36fn main ( ) -> Result < ( ) > {
7+ // Tell cargo to recompile if any .proto files change
8+ println ! ( "cargo:rerun-if-changed=proto/" ) ;
9+
10+ // Selects proto files to be read for compiling
411 let proto_files = vec ! [
512 "../../proto/pyth_lazer_transaction.proto" ,
613 "../../proto/publisher_update.proto" ,
714 ] ;
815
9- prost_build:: compile_protos ( & proto_files, & [ "../../proto" ] ) ?;
16+ // Compiles protos and generates Rust types
17+ // Generated types are present in the output folder
18+ prost_build:: compile_protos ( & proto_files, & [ "../../proto" ] )
19+ . expect ( "Failed to compile protos and generate types" ) ;
1020
1121 Ok ( ( ) )
1222}
You can’t perform that action at this time.
0 commit comments