File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,13 +67,15 @@ impl PayloadBuilderAttributes for RollkitEnginePayloadBuilderAttributes {
6767
6868 // Decode transactions from bytes if provided
6969 let mut transactions = Vec :: new ( ) ;
70- if let Some ( tx_bytes_vec) = attributes. transactions {
71- for tx_bytes in tx_bytes_vec {
72- // Decode the transaction from RLP bytes (as sent by Go client)
73- let tx = TransactionSigned :: network_decode ( & mut tx_bytes. as_ref ( ) )
74- . map_err ( |e| RollkitEngineError :: InvalidTransactionData ( e. to_string ( ) ) ) ?;
75- transactions. push ( tx) ;
76- }
70+ let transactions = attributes
71+ . transactions
72+ . unwrap_or_default ( )
73+ . into_iter ( )
74+ . map ( |tx_bytes| {
75+ TransactionSigned :: network_decode ( & mut tx_bytes. as_ref ( ) )
76+ . map_err ( |e| RollkitEngineError :: InvalidTransactionData ( e. to_string ( ) ) )
77+ } )
78+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
7779 }
7880
7981 Ok ( Self {
You can’t perform that action at this time.
0 commit comments