Skip to content

Commit 9db5cef

Browse files
authored
feat(fgw): add transaction methods for GatewayProvider (#383)
1 parent 0a40c2a commit 9db5cef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+429
-172
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Next release
44

5+
- feat(fgw): added `add_transaction` for gateway client
56
- fix(fgw): include `l1_to_l2_consumed_message` in L1 handler receipt
67
- build: up starknet-rs, starknet-types, blockifier(v0.8.0), cairo
78
- feat(rpc): added `getCompiledCasm` method

Cargo.lock

Lines changed: 35 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ members = [
55
"crates/client/sync",
66
"crates/client/eth",
77
"crates/client/rpc",
8-
"crates/client/gateway",
8+
"crates/client/gateway/client",
9+
"crates/client/gateway/server",
910
"crates/client/analytics",
1011
"crates/client/telemetry",
1112
"crates/client/devnet",
@@ -32,7 +33,8 @@ default-members = [
3233
"crates/client/exec",
3334
"crates/client/sync",
3435
"crates/client/eth",
35-
"crates/client/gateway",
36+
"crates/client/gateway/client",
37+
"crates/client/gateway/server",
3638
"crates/client/rpc",
3739
"crates/client/telemetry",
3840
"crates/client/devnet",
@@ -114,7 +116,8 @@ mc-telemetry = { path = "crates/client/telemetry" }
114116
mc-db = { path = "crates/client/db" }
115117
mc-exec = { path = "crates/client/exec" }
116118
mc-rpc = { path = "crates/client/rpc" }
117-
mc-gateway = { path = "crates/client/gateway" }
119+
mc-gateway-client = { path = "crates/client/gateway/client" }
120+
mc-gateway-server = { path = "crates/client/gateway/server" }
118121
mc-sync = { path = "crates/client/sync" }
119122
mc-eth = { path = "crates/client/eth" }
120123
mc-mempool = { path = "crates/client/mempool" }

crates/client/gateway/Cargo.toml renamed to crates/client/gateway/client/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
2-
description = "Madara client rpc service"
3-
name = "mc-gateway"
2+
description = "Madara gateway client provider"
3+
name = "mc-gateway-client"
44
authors.workspace = true
55
edition.workspace = true
66
license.workspace = true
@@ -17,12 +17,9 @@ targets = ["x86_64-unknown-linux-gnu"]
1717
[dependencies]
1818

1919
# Madara
20-
mc-db.workspace = true
21-
mc-rpc.workspace = true
2220
mp-block.workspace = true
2321
mp-class.workspace = true
2422
mp-gateway.workspace = true
25-
mp-utils.workspace = true
2623

2724
# Starknet
2825
starknet-core.workspace = true
@@ -39,7 +36,6 @@ hyper-tls.workspace = true
3936
hyper-util.workspace = true
4037
serde = { workspace = true, features = ["derive"] }
4138
serde_json.workspace = true
42-
thiserror.workspace = true
4339
tokio.workspace = true
4440
tower = { version = "0.4", features = ["timeout", "retry", "util", "limit"] }
4541
tracing.workspace = true

crates/client/gateway/src/client/builder.rs renamed to crates/client/gateway/client/src/builder.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ type HttpsClient = Client<HttpsConnector<HttpConnector>, String>;
2323
type TimeoutRetryClient = Retry<RetryPolicy, Timeout<HttpsClient>>;
2424
pub type PausedClient = PauseLayerMiddleware<TimeoutRetryClient>;
2525
#[derive(Debug, Clone)]
26-
pub struct FeederClient {
26+
pub struct GatewayProvider {
2727
pub(crate) client: PausedClient,
28-
#[allow(dead_code)]
2928
pub(crate) gateway_url: Url,
3029
pub(crate) feeder_gateway_url: Url,
3130
pub(crate) headers: HeaderMap,
3231
}
3332

34-
impl FeederClient {
33+
impl GatewayProvider {
3534
pub fn new(gateway_url: Url, feeder_gateway_url: Url) -> Self {
3635
let pause_until = Arc::new(RwLock::new(None));
3736
let connector = HttpsConnector::new();
@@ -77,6 +76,15 @@ impl FeederClient {
7776
.expect("Failed to parse Starknet Alpha Sepolia feeder gateway url. This should not fail in prod."),
7877
)
7978
}
79+
pub fn starknet_integration_sepolia() -> Self {
80+
Self::new(
81+
Url::parse("https://integration-sepolia.starknet.io/gateway/")
82+
.expect("Failed to parse Starknet Integration Sepolia gateway url. This should not fail in prod."),
83+
Url::parse("https://integration-sepolia.starknet.io/feeder_gateway/").expect(
84+
"Failed to parse Starknet Integration Sepolia feeder gateway url. This should not fail in prod.",
85+
),
86+
)
87+
}
8088
}
8189

8290
#[derive(Clone, Debug)]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mod builder;
2+
mod methods;
3+
mod request_builder;
4+
5+
pub use builder::GatewayProvider;

0 commit comments

Comments
 (0)