(
ex: &mut PgTransaction<'_>,
refund: &Refund,
)
| 108 | |
| 109 | #[instrument(skip_all)] |
| 110 | pub async fn insert_refund_tx_hash( |
| 111 | ex: &mut PgTransaction<'_>, |
| 112 | refund: &Refund, |
| 113 | ) -> Result<(), sqlx::Error> { |
| 114 | const QUERY: &str = r#" |
| 115 | INSERT INTO ethflow_refunds (order_uid, block_number, tx_hash) VALUES($1, $2, $3) |
| 116 | ON CONFLICT (order_uid) DO UPDATE SET block_number = $2, tx_hash = $3 |
| 117 | "#; |
| 118 | |
| 119 | ex.execute( |
| 120 | sqlx::query(QUERY) |
| 121 | .bind(refund.order_uid) |
| 122 | .bind(i64::try_from(refund.block_number).unwrap_or(i64::MAX)) |
| 123 | .bind(refund.tx_hash), |
| 124 | ) |
| 125 | .await?; |
| 126 | Ok(()) |
| 127 | } |
| 128 | |
| 129 | #[instrument(skip_all)] |
| 130 | pub async fn refundable_orders( |
no test coverage detected