diff --git a/src/tasks/submit.rs b/src/tasks/submit.rs index e5e002b..6065a7d 100644 --- a/src/tasks/submit.rs +++ b/src/tasks/submit.rs @@ -192,9 +192,6 @@ impl SubmitTask { resp: &SignResponse, block: &BuiltBlock, ) -> Result { - // TODO: ENG-1082 Implement fills - let fills = vec![]; - // manually retrieve nonce let nonce = self.provider().get_transaction_count(self.provider().default_signer_address()).await?; @@ -222,6 +219,10 @@ impl SubmitTask { }; debug!(?header, "built block header"); + // Extract fills from the built block + let fills = self.extract_fills(block); + debug!(?fills, "extracted fills"); + // Create a blob transaction with the blob header and signature values and return it let tx = self .build_blob_tx(fills, header, v, r, s, block)? @@ -394,6 +395,11 @@ impl SubmitTask { Ok(block_num + 1) } + // This function converts &[SignedFill] into [FillPermit2] + fn extract_fills(&self, block: &BuiltBlock) -> Vec { + block.host_fills().iter().map(FillPermit2::from).collect() + } + /// Task future for the submit task /// NB: This task assumes that the simulator will only send it blocks for /// slots that it's assigned.