Skip to content

Commit e90f0e8

Browse files
committed
Execute solana payloads only for succesfull withdrawals
1 parent d21da91 commit e90f0e8

File tree

2 files changed

+50
-29
lines changed

2 files changed

+50
-29
lines changed

Cargo.lock

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/engine/bridge/mod.rs

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,37 +1348,53 @@ impl Bridge {
13481348
if let Some(message) = sol_message_execute {
13491349
tracing::info!(
13501350
%proposal_pubkey,
1351-
"execute proposal",
1351+
"executing proposal...",
13521352
);
13531353

1354-
if let Err(e) = sol_subscriber
1354+
match sol_subscriber
13551355
.send_message(rpc_client, message, &self.context.keystore)
13561356
.await
13571357
.map_err(parse_client_error)
13581358
{
1359-
tracing::error!(
1360-
%proposal_pubkey,
1361-
"failed to execute solana proposal: {e:?}",
1362-
);
1363-
}
1364-
}
1359+
Ok(_) => {
1360+
tracing::info!(
1361+
%proposal_pubkey,
1362+
"proposal was executed",
1363+
);
13651364

1366-
// Execute payload
1367-
if let Some(message) = sol_message_execute_payload {
1368-
tracing::info!(
1369-
%proposal_pubkey,
1370-
"execute payload",
1371-
);
1365+
// Execute payload
1366+
if let Some(message) = sol_message_execute_payload {
1367+
tracing::info!(
1368+
%proposal_pubkey,
1369+
"executing payload...",
1370+
);
13721371

1373-
if let Err(e) = sol_subscriber
1374-
.send_message(rpc_client, message, &self.context.keystore)
1375-
.await
1376-
.map_err(parse_client_error)
1377-
{
1378-
tracing::error!(
1379-
%proposal_pubkey,
1380-
"failed to execute solana payload: {e:?}",
1381-
);
1372+
match sol_subscriber
1373+
.send_message(rpc_client, message, &self.context.keystore)
1374+
.await
1375+
.map_err(parse_client_error)
1376+
{
1377+
Ok(_) => {
1378+
tracing::info!(
1379+
%proposal_pubkey,
1380+
"payload was executed",
1381+
);
1382+
}
1383+
Err(e) => {
1384+
tracing::error!(
1385+
%proposal_pubkey,
1386+
"failed to execute solana payload: {e:?}",
1387+
);
1388+
}
1389+
}
1390+
}
1391+
}
1392+
Err(e) => {
1393+
tracing::error!(
1394+
%proposal_pubkey,
1395+
"failed to execute solana proposal: {e:?}",
1396+
);
1397+
}
13821398
}
13831399
}
13841400
}

0 commit comments

Comments
 (0)