Skip to content

Commit f9d8dbb

Browse files
committed
refactor: unneeded changes
1 parent a3adbb3 commit f9d8dbb

File tree

4 files changed

+31
-16
lines changed

4 files changed

+31
-16
lines changed

coprocessor/fhevm-engine/transaction-sender/src/ops/add_ciphertext.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,19 @@ where
146146
handle = h,
147147
"addCiphertext txn failed"
148148
);
149+
149150
self.increment_txn_limited_retries_count(
150151
handle,
151152
"receipt status = false",
152153
current_limited_retries_count,
153154
)
154155
.await?;
156+
155157
return Err(anyhow::anyhow!(
156158
"Transaction {} failed with status {}, handle: {}",
157159
receipt.transaction_hash,
158160
receipt.status(),
159-
h
161+
h,
160162
));
161163
}
162164
Ok(())

coprocessor/fhevm-engine/transaction-sender/src/ops/allow_handle.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,20 @@ where
172172
handle = h,
173173
"allowAccount txn failed"
174174
);
175-
let reason = format!(
176-
"Transaction {} failed with status {}",
175+
176+
self.increment_txn_limited_retries_count(
177+
key,
178+
"receipt status = false",
179+
current_limited_retries_count,
180+
)
181+
.await?;
182+
183+
return Err(anyhow::anyhow!(
184+
"Transaction {} failed with status {}, handle: {}",
177185
receipt.transaction_hash,
178186
receipt.status(),
179-
);
180-
self.increment_txn_limited_retries_count(key, &reason, current_limited_retries_count)
181-
.await?;
182-
return Err(anyhow::anyhow!("{reason}, handle: {h}",));
187+
h,
188+
));
183189
}
184190
Ok(())
185191
}
@@ -374,8 +380,8 @@ where
374380
let rows = sqlx::query!(
375381
"
376382
SELECT handle, account_address, event_type, txn_limited_retries_count, txn_unlimited_retries_count, transaction_id
377-
FROM allowed_handles
378-
WHERE txn_is_sent = false
383+
FROM allowed_handles
384+
WHERE txn_is_sent = false
379385
AND txn_limited_retries_count < $1
380386
LIMIT $2;
381387
",

coprocessor/fhevm-engine/transaction-sender/src/ops/delegate_user_decrypt.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ impl<P: Provider<Ethereum> + Clone + 'static> DelegateUserDecryptOperation<P> {
192192
"{operation} txn failed"
193193
);
194194
TxResult::OtherError(format!(
195-
"Transaction {transaction_hash} failed with status false"
195+
"Transaction {} failed with status {}, Delegation: {:?}",
196+
transaction_hash,
197+
receipt.status(),
198+
delegation,
196199
))
197200
}
198201
}

coprocessor/fhevm-engine/transaction-sender/src/ops/verify_proof.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,18 @@ where
213213
status = receipt.status(),
214214
"Transaction failed"
215215
);
216-
let reason = format!(
217-
"Transaction {} failed with status {}",
216+
self.update_retry_count_by_proof_id(
217+
txn_request.0,
218+
current_retry_count,
219+
"receipt status = false",
220+
)
221+
.await?;
222+
return Err(anyhow::anyhow!(
223+
"Transaction {} for zk_proof_id {} failed with status {}",
218224
receipt.transaction_hash,
225+
txn_request.0,
219226
receipt.status(),
220-
);
221-
self.update_retry_count_by_proof_id(txn_request.0, current_retry_count, &reason)
222-
.await?;
223-
return Err(anyhow::anyhow!("{reason}, zk_proof_id: {}", txn_request.0,));
227+
));
224228
}
225229
Ok(())
226230
}

0 commit comments

Comments
 (0)