MCPcopy Create free account
hub / github.com/base/base / decode_tx_data

Method decode_tx_data

crates/consensus/protocol/src/batch/transactions.rs:236–255  ·  view source on GitHub ↗

Decode the transaction data from a reader.

(&mut self, r: &mut &[u8])

Source from the content-addressed store, hash-verified

234
235 /// Decode the transaction data from a reader.
236 pub fn decode_tx_data(&mut self, r: &mut &[u8]) -> Result<(), SpanBatchError> {
237 let mut tx_data = Vec::new();
238 let mut tx_types = Vec::new();
239
240 // Do not need the transaction data header because the RLP stream already includes the
241 // length information.
242 for _ in 0..self.total_block_tx_count {
243 let (tx_data_item, tx_type) = read_tx_data(r)?;
244 tx_data.push(tx_data_item);
245 tx_types.push(tx_type);
246 if matches!(tx_type, OpTxType::Legacy) {
247 self.legacy_tx_count += 1;
248 }
249 }
250
251 self.tx_data = tx_data;
252 self.tx_types = tx_types;
253
254 Ok(())
255 }
256
257 /// Decode the EIP-8130 auth proofs from a reader, reading one
258 /// `(sender_proof, payer_proof)` bundle for each EIP-8130 transaction in

Callers 1

decodeMethod · 0.80

Calls 2

read_tx_dataFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected