@@ -67,9 +67,9 @@ impl MultiSolMacroGen {
6767 Ok ( ( ) )
6868 }
6969
70- pub fn generate_bindings ( & mut self ) -> Result < ( ) > {
70+ pub fn generate_bindings ( & mut self , all_derives : bool ) -> Result < ( ) > {
7171 for instance in & mut self . instances {
72- Self :: generate_binding ( instance) . wrap_err_with ( || {
72+ Self :: generate_binding ( instance, all_derives ) . wrap_err_with ( || {
7373 format ! (
7474 "failed to generate bindings for {}:{}" ,
7575 instance. path. display( ) ,
@@ -81,15 +81,15 @@ impl MultiSolMacroGen {
8181 Ok ( ( ) )
8282 }
8383
84- fn generate_binding ( instance : & mut SolMacroGen ) -> Result < ( ) > {
84+ fn generate_binding ( instance : & mut SolMacroGen , all_derives : bool ) -> Result < ( ) > {
8585 let input = instance. get_sol_input ( ) ?. normalize_json ( ) ?;
8686
8787 let SolInput { attrs : _, path : _, kind } = input;
8888
8989 let tokens = match kind {
9090 SolInputKind :: Sol ( mut file) => {
9191 let sol_attr: syn:: Attribute = syn:: parse_quote! {
92- #[ sol( rpc, alloy_sol_types = alloy:: sol_types, alloy_contract = alloy:: contract) ]
92+ #[ sol( rpc, alloy_sol_types = alloy:: sol_types, alloy_contract = alloy:: contract, all_derives = #all_derives ) ]
9393 } ;
9494 file. attrs . push ( sol_attr) ;
9595 expand ( file) . wrap_err ( "failed to expand" ) ?
@@ -101,6 +101,7 @@ impl MultiSolMacroGen {
101101 Ok ( ( ) )
102102 }
103103
104+ #[ allow( clippy:: too_many_arguments) ]
104105 pub fn write_to_crate (
105106 & mut self ,
106107 name : & str ,
@@ -109,8 +110,9 @@ impl MultiSolMacroGen {
109110 single_file : bool ,
110111 alloy_version : Option < String > ,
111112 alloy_rev : Option < String > ,
113+ all_derives : bool ,
112114 ) -> Result < ( ) > {
113- self . generate_bindings ( ) ?;
115+ self . generate_bindings ( all_derives ) ?;
114116
115117 let src = bindings_path. join ( "src" ) ;
116118
@@ -172,8 +174,13 @@ edition = "2021"
172174 Ok ( ( ) )
173175 }
174176
175- pub fn write_to_module ( & mut self , bindings_path : & Path , single_file : bool ) -> Result < ( ) > {
176- self . generate_bindings ( ) ?;
177+ pub fn write_to_module (
178+ & mut self ,
179+ bindings_path : & Path ,
180+ single_file : bool ,
181+ all_derives : bool ,
182+ ) -> Result < ( ) > {
183+ self . generate_bindings ( all_derives) ?;
177184
178185 let _ = fs:: create_dir_all ( bindings_path) ;
179186
0 commit comments