Skip to content

Commit

Permalink
[TRIVIAL] Move commit to bottom of OnSettlementEventUpdater (#2864)
Browse files Browse the repository at this point in the history
# Description
Moves committing to database bellow the temporary added code that builds
the domain::Settlement because domain:Settlement reports
`WrongEnvironment` for each settlement if settlement is already
processed (saved to database).

This is needed to test the new Settlement code.
  • Loading branch information
sunce86 authored Aug 6, 2024
1 parent f13cd3a commit e95ce8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/autopilot/src/on_settlement_event_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,6 @@ impl Inner {

tracing::debug!(?hash, ?update, "updating settlement details for tx");

Postgres::update_settlement_details(&mut ex, update.clone())
.await
.with_context(|| format!("insert_settlement_details: {update:?}"))?;
ex.commit().await?;

{
// temporary to debug and compare with current implementation
// TODO: use instead of current implementation
Expand All @@ -203,6 +198,11 @@ impl Inner {
);
}

Postgres::update_settlement_details(&mut ex, update.clone())
.await
.with_context(|| format!("insert_settlement_details: {update:?}"))?;
ex.commit().await?;

Ok(true)
}

Expand Down

0 comments on commit e95ce8b

Please sign in to comment.