File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,11 @@ impl<S: Sleeper> AsyncClient<S> {
394394 maxfeerate : Option < f64 > ,
395395 maxburnamount : Option < f64 > ,
396396 ) -> Result < SubmitPackageResult , Error > {
397+ let serialized_txs = transactions
398+ . iter ( )
399+ . map ( |tx| serialize_hex ( & tx) )
400+ . collect :: < Vec < _ > > ( ) ;
401+
397402 let mut queryparams = HashSet :: < ( & str , String ) > :: new ( ) ;
398403 if let Some ( maxfeerate) = maxfeerate {
399404 queryparams. insert ( ( "maxfeerate" , maxfeerate. to_string ( ) ) ) ;
@@ -402,15 +407,10 @@ impl<S: Sleeper> AsyncClient<S> {
402407 queryparams. insert ( ( "maxburnamount" , maxburnamount. to_string ( ) ) ) ;
403408 }
404409
405- let serialized_txs = transactions
406- . iter ( )
407- . map ( |tx| serialize_hex ( & tx) )
408- . collect :: < Vec < _ > > ( ) ;
409-
410410 let response = self
411411 . post_request_bytes (
412412 "/txs/package" ,
413- serde_json:: to_string ( & serialized_txs) . unwrap_or_default ( ) ,
413+ serde_json:: to_string ( & serialized_txs) . map_err ( Error :: SerdeJson ) ? ,
414414 Some ( queryparams) ,
415415 )
416416 . await ?;
Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ impl BlockingClient {
332332 let mut request = self . post_request (
333333 "/txs/package" ,
334334 serde_json:: to_string ( & serialized_txs)
335- . unwrap_or_default ( )
335+ . map_err ( Error :: SerdeJson ) ?
336336 . into_bytes ( ) ,
337337 ) ?;
338338
You can’t perform that action at this time.
0 commit comments