Skip to content

Commit 9743149

Browse files
committed
root: Extract node-client crate
A lot of crates no longer awkwardly depend on `app-rs` when all they needed was the node client.
1 parent 723f511 commit 9743149

File tree

18 files changed

+368
-271
lines changed

18 files changed

+368
-271
lines changed

Cargo.lock

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ members = [
1717
"lexe-tokio",
1818
"logger",
1919
"node",
20+
"node-client",
2021
"payment-uri",
2122
"payment-uri-core",
2223
"petname",

app-rs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ lexe-api.path = "../lexe-api"
2727
lexe-std.path = "../lexe-std"
2828
lexe-tls.path = "../lexe-tls"
2929
lexe-tokio.path = "../lexe-tokio"
30+
node-client.path = "../node-client"
3031
payment-uri.path = "../payment-uri"
3132

3233
# --- WORKSPACE --- #

app-rs/src/app.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ use common::{
3434
use lexe_api::def::{AppBackendApi, AppGatewayApi, AppNodeProvisionApi};
3535
use lexe_std::Apply;
3636
use lexe_tokio::task::LxTask;
37+
use node_client::{
38+
client::{GatewayClient, NodeClient},
39+
credentials::Credentials,
40+
};
3741
use payment_uri::{bip353, lnurl};
3842
use secrecy::ExposeSecret;
3943
use tracing::{info, info_span, instrument, warn};
4044

4145
use crate::{
4246
app_data::AppDataRs,
43-
client::{Credentials, GatewayClient, NodeClient},
4447
db::WritebackDb,
4548
ffs::{Ffs, FlatFileFs},
4649
payments_db::{self, PaymentSyncSummary, PaymentsDb},

app-rs/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
pub mod app;
1717
/// The app's general database.
1818
mod app_data;
19-
/// The app's clients to the node and gateway.
20-
pub mod client;
2119
/// Persistence logic for data stored.
2220
pub mod db;
2321
/// The flutter/rust FFI bindings.

app-rs/src/payments_db.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ use lexe_api::{
6161
VecBasicPaymentV2,
6262
},
6363
};
64+
use node_client::client::NodeClient;
6465
use tracing::warn;
6566

66-
use crate::{client::NodeClient, ffs::Ffs};
67+
use crate::ffs::Ffs;
6768

6869
/// Sync the app's local payment state from the user node.
6970
///

app_rs_dart/build_rust_ios_macos.input.xcfilelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ${PODS_TARGET_SRCROOT}/../../lexe-tls-core/Cargo.toml
1616
${PODS_TARGET_SRCROOT}/../../lexe-tls/Cargo.toml
1717
${PODS_TARGET_SRCROOT}/../../lexe-tokio/Cargo.toml
1818
${PODS_TARGET_SRCROOT}/../../logger/Cargo.toml
19+
${PODS_TARGET_SRCROOT}/../../node-client/Cargo.toml
1920
${PODS_TARGET_SRCROOT}/../../node/Cargo.toml
2021
${PODS_TARGET_SRCROOT}/../../payment-uri-core/Cargo.toml
2122
${PODS_TARGET_SRCROOT}/../../payment-uri/Cargo.toml

lexe-api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ lexe-tokio.path = "../lexe-tokio"
3535
anyhow.workspace = true
3636
axum = { workspace = true, features = ["json", "query"] }
3737
axum-server.workspace = true
38+
base64.workspace = true
3839
bcs.workspace = true
3940
bytes.workspace = true
4041
http.workspace = true

node-client/Cargo.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[package]
2+
name = "node-client"
3+
authors.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
version.workspace = true
7+
8+
[features]
9+
default = []
10+
test-utils = ["proptest-derive"]
11+
12+
[dependencies]
13+
# --- LEXE --- #
14+
15+
common.path = "../common"
16+
lexe-api.path = "../lexe-api"
17+
lexe-tls.path = "../lexe-tls"
18+
19+
# --- WORKSPACE --- #
20+
21+
anyhow.workspace = true
22+
async-trait.workspace = true
23+
base64.workspace = true
24+
http.workspace = true
25+
reqwest.workspace = true
26+
serde.workspace = true
27+
serde_json.workspace = true
28+
29+
# --- OPTIONAL --- #
30+
31+
proptest-derive = { workspace = true, optional = true }
32+
33+
[dev-dependencies]
34+
common = { path = "../common", features = ["test-utils"] }
35+
proptest.workspace = true
36+
proptest-derive.workspace = true

0 commit comments

Comments
 (0)