summaryrefslogtreecommitdiff
path: root/wire-gateway
diff options
context:
space:
mode:
Diffstat (limited to 'wire-gateway')
-rw-r--r--wire-gateway/Cargo.toml2
-rw-r--r--wire-gateway/src/main.rs68
2 files changed, 36 insertions, 34 deletions
diff --git a/wire-gateway/Cargo.toml b/wire-gateway/Cargo.toml
index f73af0f..e41668f 100644
--- a/wire-gateway/Cargo.toml
+++ b/wire-gateway/Cargo.toml
@@ -37,7 +37,7 @@ bitcoin = { version = "0.31.0" }
ethereum-types = { version = "0.14.1", default-features = false }
# Cli args parser
clap = { version = "4.4.6", features = ["derive"] }
-clap_lex = "0.6.0"
+clap_lex = "0.7.0"
[features]
# Enable test admin endpoint
diff --git a/wire-gateway/src/main.rs b/wire-gateway/src/main.rs
index 98c7589..6a1b731 100644
--- a/wire-gateway/src/main.rs
+++ b/wire-gateway/src/main.rs
@@ -412,28 +412,28 @@ async fn router(
)?;
let transactions: Vec<_> = db
.query(
- &format!("SELECT id, _date, amount, reserve_pub, debit_acc FROM tx_in {}", filter),
+ &format!(
+ "SELECT id, _date, amount, reserve_pub, debit_acc FROM tx_in {}",
+ filter
+ ),
&[],
)
- .await.catch_code(
- StatusCode::BAD_GATEWAY,
- ErrorCode::GENERIC_DB_FETCH_FAILED,
- )?
+ .await
+ .catch_code(StatusCode::BAD_GATEWAY, ErrorCode::GENERIC_DB_FETCH_FAILED)?
.into_iter()
- .map(| row| {
- IncomingBankTransaction::IncomingReserveTransaction {
+ .map(|row| IncomingBankTransaction::IncomingReserveTransaction {
row_id: sql_safe_u64(&row, 0),
date: Timestamp::Time(row.get(1)),
amount: sql_amount(&row, 2),
reserve_pub: ShortHashCode::from(sql_array(&row, 3)),
debit_account: sql_url(&row, 4),
- }
- }).collect();
+ })
+ .collect();
if transactions.is_empty() {
Response::builder()
- .status(StatusCode::NO_CONTENT)
- .body(Body::empty())
- .unwrap()
+ .status(StatusCode::NO_CONTENT)
+ .body(Body::empty())
+ .unwrap()
} else {
encode_body(
parts,
@@ -455,15 +455,16 @@ async fn router(
StatusCode::GATEWAY_TIMEOUT,
ErrorCode::GENERIC_DB_FETCH_FAILED,
)?;
- let transactions: Vec<_> =db
+ let transactions: Vec<_> = db
.query(
- &format!("SELECT id, _date, amount, wtid, credit_acc, exchange_url FROM tx_out {}", filter),
+ &format!(
+ "SELECT id, _date, amount, wtid, credit_acc, exchange_url FROM tx_out {}",
+ filter
+ ),
&[],
)
- .await.catch_code(
- StatusCode::BAD_GATEWAY,
- ErrorCode::GENERIC_DB_FETCH_FAILED,
- )?
+ .await
+ .catch_code(StatusCode::BAD_GATEWAY, ErrorCode::GENERIC_DB_FETCH_FAILED)?
.into_iter()
.map(|row| OutgoingBankTransaction {
row_id: sql_safe_u64(&row, 0),
@@ -471,24 +472,25 @@ async fn router(
amount: sql_amount(&row, 2),
wtid: ShortHashCode::from(sql_array(&row, 3)),
credit_account: sql_url(&row, 4),
- exchange_base_url:sql_url(&row, 5),
- }).collect();
- if transactions.is_empty() {
- Response::builder()
+ exchange_base_url: sql_url(&row, 5),
+ })
+ .collect();
+ if transactions.is_empty() {
+ Response::builder()
.status(StatusCode::NO_CONTENT)
.body(Body::empty())
.unwrap()
- } else {
- encode_body(
- parts,
- StatusCode::OK,
- &OutgoingHistory {
- debit_account: state.payto.clone(),
- outgoing_transactions: transactions,
- },
- )
- .unexpected()?
- }
+ } else {
+ encode_body(
+ parts,
+ StatusCode::OK,
+ &OutgoingHistory {
+ debit_account: state.payto.clone(),
+ outgoing_transactions: transactions,
+ },
+ )
+ .unexpected()?
+ }
}
#[cfg(feature = "test")]
"/admin/add-incoming" => {