Skip to content

Commit 34375b2

Browse files
committed
refactor: rename errors to NonPayingNotAllowed
1 parent cbd24b4 commit 34375b2

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

batcher/aligned-batcher/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ impl Batcher {
642642
error!("Failed to generate non paying data");
643643
send_message(
644644
ws_conn_sink.clone(),
645-
SubmitProofResponseMessage::NonPayingAddressError,
645+
SubmitProofResponseMessage::NonPayingNotAllowed,
646646
)
647647
.await;
648648
return Ok(());
@@ -1774,7 +1774,7 @@ impl Batcher {
17741774
info!("Handling nonpaying message");
17751775
let Some(non_paying_config) = self.non_paying_config.as_ref() else {
17761776
warn!("There isn't a non-paying configuration loaded. This message will be ignored");
1777-
return Err(TransactionSendError::NonPayingAddressNotAllowed);
1777+
return Err(TransactionSendError::NonPayingNotAllowed);
17781778
};
17791779

17801780
let nonced_verification_data = NoncedVerificationData::new(
@@ -1785,7 +1785,8 @@ impl Batcher {
17851785
self.payment_service.address(),
17861786
);
17871787

1788-
let client_msg = SubmitProofMessage::new(
1788+
// We need to sign a message with the non-paying replacement address
1789+
let non_paying_replacement_msg = SubmitProofMessage::new(
17891790
client_msg.verification_data.clone(),
17901791
non_paying_config.replacement.clone(),
17911792
)
@@ -1795,7 +1796,7 @@ impl Batcher {
17951796
Ok(NonPayingData {
17961797
address: non_paying_config.replacement.address(),
17971798
nonced_verification_data,
1798-
signature: client_msg.signature,
1799+
signature: non_paying_replacement_msg.signature,
17991800
})
18001801
}
18011802

batcher/aligned-batcher/src/types/errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub enum TransactionSendError {
1111
BatchAlreadySubmitted,
1212
InsufficientFunds,
1313
OnlyBatcherAllowed,
14-
NonPayingAddressNotAllowed,
14+
NonPayingNotAllowed,
1515
Generic(String),
1616
}
1717

@@ -171,8 +171,8 @@ impl fmt::Display for TransactionSendError {
171171
TransactionSendError::Generic(e) => {
172172
write!(f, "Generic error: {}", e)
173173
}
174-
TransactionSendError::NonPayingAddressNotAllowed => {
175-
write!(f, "Non-paying address not allowed")
174+
TransactionSendError::NonPayingNotAllowed => {
175+
write!(f, "Non-paying not allowed")
176176
}
177177
}
178178
}

batcher/aligned-sdk/src/common/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ pub enum SubmitProofResponseMessage {
399399
EthRpcError,
400400
InvalidPaymentServiceAddress(Address, Address),
401401
UnderpricedProof,
402-
NonPayingAddressError,
402+
NonPayingNotAllowed,
403403
}
404404

405405
#[derive(Debug, Clone, Serialize, Deserialize)]

batcher/aligned-sdk/src/communication/messaging.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ async fn handle_batcher_response(msg: Message) -> Result<BatchInclusionData, Sub
276276
);
277277
Err(SubmitError::SerializationError(e))
278278
}
279-
Ok(SubmitProofResponseMessage::NonPayingAddressError) => {
280-
error!("Batcher responded with non-paying address error. Funds have not been spent.");
279+
Ok(SubmitProofResponseMessage::NonPayingNotAllowed) => {
280+
error!("Batcher responded with: non-paying not allowed.");
281281
Err(SubmitError::NonPayingAddressError)
282282
}
283283
}

0 commit comments

Comments
 (0)