@@ -235,7 +235,8 @@ impl Provider {
235235 /// # Returns
236236 /// A `Result<Vec<Log>, EthError>` containing the logs that match the filter.
237237 pub fn get_logs ( & self , filter : & Filter ) -> Result < Vec < Log > , EthError > {
238- let Ok ( params) = serde_json:: to_value ( filter) else {
238+ // NOTE: filter must be encased by a tuple to be serialized correctly
239+ let Ok ( params) = serde_json:: to_value ( ( filter, ) ) else {
239240 return Err ( EthError :: InvalidParams ) ;
240241 } ;
241242 let action = EthAction :: Request {
@@ -391,7 +392,8 @@ impl Provider {
391392 /// # Returns
392393 /// A `Result<Option<Transaction>, EthError>` representing the transaction, if found.
393394 pub fn get_transaction_by_hash ( & self , hash : TxHash ) -> Result < Option < Transaction > , EthError > {
394- let Ok ( params) = serde_json:: to_value ( hash) else {
395+ // NOTE: hash must be encased by a tuple to be serialized correctly
396+ let Ok ( params) = serde_json:: to_value ( ( hash, ) ) else {
395397 return Err ( EthError :: InvalidParams ) ;
396398 } ;
397399 let action = EthAction :: Request {
@@ -414,7 +416,8 @@ impl Provider {
414416 & self ,
415417 hash : TxHash ,
416418 ) -> Result < Option < TransactionReceipt > , EthError > {
417- let Ok ( params) = serde_json:: to_value ( hash) else {
419+ // NOTE: hash must be encased by a tuple to be serialized correctly
420+ let Ok ( params) = serde_json:: to_value ( ( hash, ) ) else {
418421 return Err ( EthError :: InvalidParams ) ;
419422 } ;
420423 let action = EthAction :: Request {
@@ -525,7 +528,8 @@ impl Provider {
525528 let action = EthAction :: Request {
526529 chain_id : self . chain_id ,
527530 method : "eth_sendRawTransaction" . to_string ( ) ,
528- params : serde_json:: to_value ( tx) . unwrap ( ) ,
531+ // NOTE: tx must be encased by a tuple to be serialized correctly
532+ params : serde_json:: to_value ( ( tx, ) ) . unwrap ( ) ,
529533 } ;
530534
531535 self . send_request_and_parse_response :: < TxHash > ( action)
0 commit comments