(
ex: &mut PgConnection,
index: &EventIndex,
event: &Settlement,
)
| 132 | |
| 133 | #[instrument(skip_all)] |
| 134 | pub async fn insert_settlement( |
| 135 | ex: &mut PgConnection, |
| 136 | index: &EventIndex, |
| 137 | event: &Settlement, |
| 138 | ) -> Result<(), sqlx::Error> { |
| 139 | const QUERY: &str = "\ |
| 140 | INSERT INTO settlements (tx_hash, block_number, log_index, solver) VALUES ($1, $2, $3, $4) ON \ |
| 141 | CONFLICT DO NOTHING;"; |
| 142 | sqlx::query(QUERY) |
| 143 | .bind(event.transaction_hash) |
| 144 | .bind(index.block_number) |
| 145 | .bind(index.log_index) |
| 146 | .bind(event.solver) |
| 147 | .execute(ex) |
| 148 | .await?; |
| 149 | |
| 150 | Ok(()) |
| 151 | } |
| 152 | |
| 153 | #[instrument(skip_all)] |
| 154 | async fn insert_presignature( |
no test coverage detected