Skip to content

Commit

Permalink
bridge-proxy:Only failed transactions are returned
Browse files Browse the repository at this point in the history
On the callback only in case of error should the transaction be
added to eth_failed_transaction_list.
  • Loading branch information
CostinCarabas committed Feb 6, 2024
1 parent 7a38dec commit 6943b6d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bridge-proxy/src/bridge-proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ pub trait BridgeProxyContract: config::ConfigModule {
}

#[callback]
fn failed_execution_callback(&self, tx: &EthTransactionPayment<Self::Api>) {
self.eth_failed_transaction_list().push_back(tx.clone());
fn failed_execution_callback(
&self,
#[call_result] result: ManagedAsyncCallResult<()>,
tx: &EthTransactionPayment<Self::Api>,
) {
match result {
ManagedAsyncCallResult::Ok(_) => {}
ManagedAsyncCallResult::Err(_) => {
self.eth_failed_transaction_list().push_back(tx.clone());
}
}
}

#[endpoint(refundTransactions)]
Expand Down

0 comments on commit 6943b6d

Please sign in to comment.