MCPcopy Create free account
hub / github.com/cowprotocol/services / insert_settlement

Function insert_settlement

crates/database/src/events.rs:134–151  ·  view source on GitHub ↗
(
    ex: &mut PgConnection,
    index: &EventIndex,
    event: &Settlement,
)

Source from the content-addressed store, hash-verified

132
133#[instrument(skip_all)]
134pub 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)]
154async fn insert_presignature(

Callers 6

appendFunction · 0.85
postgres_load_by_tx_hashFunction · 0.85
postgres_load_by_idFunction · 0.85
postgres_roundtripFunction · 0.85

Calls 2

queryFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected