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

Function update_settlement_solver

crates/database/src/settlements.rs:70–90  ·  view source on GitHub ↗
(
    ex: &mut PgConnection,
    block_number: i64,
    log_index: i64,
    solver: Address,
    solution_uid: i64,
)

Source from the content-addressed store, hash-verified

68
69#[instrument(skip_all)]
70pub async fn update_settlement_solver(
71 ex: &mut PgConnection,
72 block_number: i64,
73 log_index: i64,
74 solver: Address,
75 solution_uid: i64,
76) -> Result<(), sqlx::Error> {
77 const QUERY: &str = r#"
78UPDATE settlements
79SET solver = $1, solution_uid = $2
80WHERE block_number = $3 AND log_index = $4
81 ;"#;
82 sqlx::query(QUERY)
83 .bind(solver)
84 .bind(solution_uid)
85 .bind(block_number)
86 .bind(log_index)
87 .execute(ex)
88 .await
89 .map(|_| ())
90}
91
92/// Deletes all database data that referenced the deleted settlement events.
93#[instrument(skip_all)]

Callers 5

postgres_load_by_tx_hashFunction · 0.85
postgres_load_by_idFunction · 0.85
postgres_roundtripFunction · 0.85
save_settlementMethod · 0.85

Calls 2

queryFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected