Skip to content

Commit

Permalink
Check that we receive 3 eth signatures for each swap
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed Jun 29, 2021
1 parent bf1766f commit 92886dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/bin/zksync_api/src/api_server/tx_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ impl TxSender {
.unwrap_tx();

if let ZkSyncTx::Swap(tx) = &tx {
if signature.is_single() {
return Err(SubmitError::TxAdd(TxAddError::MissingEthSignature));
}
let signatures = signature.orders_signatures();
self.verify_order_eth_signature(&tx.orders.0, signatures.0.clone())
.await?;
Expand Down Expand Up @@ -623,6 +626,9 @@ impl TxSender {

for tx in txs.iter() {
if let ZkSyncTx::Swap(swap) = &tx.tx {
if tx.signature.is_single() {
return Err(SubmitError::TxAdd(TxAddError::MissingEthSignature));
}
let signatures = tx.signature.orders_signatures();
self.verify_order_eth_signature(&swap.orders.0, signatures.0.clone())
.await?;
Expand Down

0 comments on commit 92886dd

Please sign in to comment.