Skip to content

Commit 1032f18

Browse files
committed
fix: address to function
1 parent bf41b71 commit 1032f18

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

  • batcher/aligned-batcher/src

batcher/aligned-batcher/src/lib.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,15 @@ impl Batcher {
532532
Ok(())
533533
}
534534

535+
/// Returns the address that will be used for non-paying users.
536+
/// This function assumes that the non-paying configuration is set.
537+
fn replacement_address(&self) -> Address {
538+
self.non_paying_config
539+
.as_ref()
540+
.map(|config| config.replacement.address())
541+
.unwrap()
542+
}
543+
535544
async fn handle_submit_proof_msg(
536545
self: Arc<Self>,
537546
client_msg: Box<SubmitProofMessage>,
@@ -583,12 +592,7 @@ impl Batcher {
583592
} else {
584593
info!("Generating non-paying data");
585594
// If the user is not required to pay, substitute their address with a pre-funded Aligned address
586-
addr = self
587-
.non_paying_config
588-
.as_ref()
589-
.unwrap()
590-
.replacement
591-
.address();
595+
addr = self.replacement_address();
592596
// Substitute the max_fee to a high enough value to cover the gas cost of the proof
593597
let mut aux_verification_data = client_msg.verification_data.clone();
594598
aux_verification_data.max_fee = (DEFAULT_MAX_FEE_PER_PROOF * 100).into(); // 2_000 gas per proof * 100 gwei gas price (upper bound) * 100 to make sure it is enough

0 commit comments

Comments
 (0)