Repository: eigerco/lumina
Pull request #582: test(rpc): Use `AuthLevel::Skip` and provide `new_test_client_with_url`
Author: login: YakupAltay
Created: 2025-03-26T16:02:04Z | Merged: 2025-04-03T14:22:46Z

Hi @zvolin,

Following my review of https://github.com/eigerco/lumina/issues/570, I've slightly adjusted the `auth_level` logic within `new_test_client`. The tests now correctly handle both scenarios:

- Light node (`node-2`) with the **_skip-auth_** flag enabled.
- Bridge node (`node-1`) without the **_skip-auth_** flag.

I'd greatly appreciate your feedback on this update before I move forward with the remaining RPC methods.

Thanks!


Diff:
diff --git a/rpc/tests/auth_token.rs b/rpc/tests/auth_token.rs
new file mode 100644
index 000000000..60bf4b704
--- /dev/null
+++ b/rpc/tests/auth_token.rs
@@ -0,0 +1,38 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client_with_url, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_using_bridge_node() {
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let unauthorized_client =
+        new_test_client_with_url(AuthLevel::Skip, CELESTIA_BRIDGE_RPC_URL).await;
+    assert!(unauthorized_client.is_err());
+
+    for auth_level in [AuthLevel::Read, AuthLevel::Write, AuthLevel::Admin] {
+        let client = new_test_client_with_url(auth_level, CELESTIA_BRIDGE_RPC_URL)
+            .await
+            .unwrap();
+
+        match auth_level {
+            AuthLevel::Read => {
+                blob_submit(&client, &[blob.clone()]).await.unwrap_err();
+            }
+            _ => {
+                blob_submit(&client, &[blob.clone()]).await.unwrap();
+            }
+        }
+    }
+}
diff --git a/rpc/tests/blob.rs b/rpc/tests/blob.rs
index b148003b2..dba7fd906 100644
--- a/rpc/tests/blob.rs
+++ b/rpc/tests/blob.rs
@@ -17,7 +17,7 @@ use crate::utils::{random_bytes, random_bytes_array, random_ns};
 
 #[tokio::test]
 async fn blob_submit_and_get() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(5);
     let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
@@ -76,7 +76,7 @@ async fn blob_submit_and_get_with_signer() {
 
 #[tokio::test]
 async fn blob_submit_and_get_all() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespaces = &[random_ns(), random_ns()];
 
     let blobs = &[
@@ -111,7 +111,7 @@ async fn blob_submit_and_get_all() {
 
 #[tokio::test]
 async fn blob_submit_and_get_large() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(1024 * 1024);
     let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
@@ -142,7 +142,7 @@ async fn blob_submit_and_get_large() {
 
 #[tokio::test]
 async fn blob_subscribe() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
 
     let mut incoming_blobs = client.blob_subscribe(namespace).await.unwrap();
@@ -182,7 +182,7 @@ async fn blob_subscribe() {
 
 #[tokio::test]
 async fn blob_submit_too_large() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(5 * 1024 * 1024);
     let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
@@ -192,7 +192,7 @@ async fn blob_submit_too_large() {
 
 #[tokio::test]
 async fn blob_get_get_proof_wrong_ns() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(5);
     let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
@@ -212,7 +212,7 @@ async fn blob_get_get_proof_wrong_ns() {
 
 #[tokio::test]
 async fn blob_get_get_proof_wrong_commitment() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(5);
     let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
@@ -233,7 +233,7 @@ async fn blob_get_get_proof_wrong_commitment() {
 
 #[tokio::test]
 async fn blob_get_all_with_no_blobs() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let blobs = client.blob_get_all(3, &[random_ns()]).await.unwrap();
 
diff --git a/rpc/tests/das.rs b/rpc/tests/das.rs
index acfabfc86..b181ac0a6 100644
--- a/rpc/tests/das.rs
+++ b/rpc/tests/das.rs
@@ -9,7 +9,7 @@ use crate::utils::client::{new_test_client, AuthLevel};
 
 #[tokio::test]
 async fn das_sampling_stats() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let stats1 = client.das_sampling_stats().await.unwrap();
     assert!(matches!(stats1, SamplingStats { .. }));
@@ -25,7 +25,7 @@ async fn das_sampling_stats() {
 
 #[tokio::test]
 async fn das_wait_catch_up() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     client.das_wait_catch_up().await.unwrap();
 
diff --git a/rpc/tests/header.rs b/rpc/tests/header.rs
index 304e82287..94b01e4e5 100644
--- a/rpc/tests/header.rs
+++ b/rpc/tests/header.rs
@@ -8,7 +8,7 @@ use crate::utils::client::{new_test_client, AuthLevel};
 
 #[tokio::test]
 async fn local_head() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let local_head = client.header_local_head().await.unwrap();
 
@@ -26,7 +26,7 @@ async fn local_head() {
 
 #[tokio::test]
 async fn get_by_height() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let genesis_header = client.header_get_by_height(1).await.unwrap();
     let second_header = client.header_get_by_height(2).await.unwrap();
@@ -37,14 +37,14 @@ async fn get_by_height() {
 
 #[tokio::test]
 async fn get_by_height_non_existent() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     client.header_get_by_height(999_999_999).await.unwrap_err();
 }
 
 #[tokio::test]
 async fn get_by_hash() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let genesis_header = client.header_get_by_height(1).await.unwrap();
     let genesis_header2 = client
@@ -57,7 +57,7 @@ async fn get_by_hash() {
 
 #[tokio::test]
 async fn get_range_by_height() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let genesis_header = client.header_get_by_height(1).await.unwrap();
     let second_header = client.header_get_by_height(2).await.unwrap();
@@ -73,7 +73,7 @@ async fn get_range_by_height() {
 
 #[tokio::test]
 async fn network_head() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let network_head = client.header_network_head().await.unwrap();
 
@@ -90,7 +90,7 @@ async fn network_head() {
 
 #[tokio::test]
 async fn subscribe() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let genesis_header = client.header_get_by_height(1).await.unwrap();
 
@@ -104,7 +104,7 @@ async fn subscribe() {
 
 #[tokio::test]
 async fn sync_state() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let state1 = client.header_sync_state().await.unwrap();
 
diff --git a/rpc/tests/p2p.rs b/rpc/tests/p2p.rs
index 164ecf340..1815ddbee 100644
--- a/rpc/tests/p2p.rs
+++ b/rpc/tests/p2p.rs
@@ -9,7 +9,7 @@ pub mod utils;
 
 #[tokio::test]
 async fn info_test() {
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     client.p2p_info().await.expect("Failed to get node info");
 }
 
@@ -19,7 +19,7 @@ async fn add_remove_peer_test() {
     let addr_info = utils::tiny_node::start_tiny_node()
         .await
         .expect("failed to spin up second node");
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let initial_peers = client
         .p2p_peers()
@@ -75,7 +75,7 @@ async fn protect_unprotect_test() {
     let addr_info = utils::tiny_node::start_tiny_node()
         .await
         .expect("failed to spin up second node");
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     client
         .p2p_connect(&addr_info)
@@ -125,7 +125,7 @@ async fn peer_block_unblock_test() {
     let addr_info = utils::tiny_node::start_tiny_node()
         .await
         .expect("failed to spin up second node");
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let blocked_peers = client
         .p2p_list_blocked_peers()
@@ -162,7 +162,7 @@ async fn peer_block_unblock_test() {
 async fn bandwidth_stats_test() {
     // just check whether we can get the data without error, node could have been running any
     // amount of time, so any value should be valid.
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     client
         .p2p_bandwidth_stats()
         .await
@@ -174,7 +174,7 @@ async fn bandwidth_for_peer_test() {
     let local_key = identity::Keypair::generate_ed25519();
     let local_peer_id = p2p::PeerId(PeerId::from(local_key.public()));
 
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let stats = client
         .p2p_bandwidth_for_peer(&local_peer_id)
         .await
@@ -189,7 +189,7 @@ async fn bandwidth_for_peer_test() {
 
 #[tokio::test]
 async fn bandwidth_for_protocol_test() {
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     // query for nonsense protocol name so that we get all zeros in response
     // until we have better way of inducing traffic
@@ -206,7 +206,7 @@ async fn bandwidth_for_protocol_test() {
 #[tokio::test]
 async fn nat_status_test() {
     // just query for status and make sure no errors happen, since any value is potentially correct
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let _ = client
         .p2p_nat_status()
         .await
@@ -218,7 +218,7 @@ async fn peer_info_test() {
     let addr_info = utils::tiny_node::start_tiny_node()
         .await
         .expect("failed to spin up second node");
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     client
         .p2p_connect(&addr_info)
@@ -242,7 +242,7 @@ async fn peer_info_test() {
 
 #[tokio::test]
 async fn pub_sub_peers_test() {
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let peers = client
         .p2p_pub_sub_peers("topic")
         .await
@@ -254,7 +254,7 @@ async fn pub_sub_peers_test() {
 #[tokio::test]
 async fn resource_state_test() {
     // cannot really test values here, just make sure it deserializes correctly
-    let client = new_test_client(AuthLevel::Admin).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     client
         .p2p_resource_state()
         .await
diff --git a/rpc/tests/share.rs b/rpc/tests/share.rs
index 16f7cad3e..44b5a950f 100644
--- a/rpc/tests/share.rs
+++ b/rpc/tests/share.rs
@@ -12,7 +12,7 @@ use crate::utils::{random_bytes, random_ns, random_ns_range};
 
 #[tokio::test]
 async fn get_share() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let header = client.header_network_head().await.unwrap();
     let square_width = header.dah.square_width() as u64;
 
@@ -28,7 +28,7 @@ async fn get_share() {
 
 #[tokio::test]
 async fn get_shares_by_namespace() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let blobs: Vec<_> = (0..4)
         .map(|_| {
@@ -57,7 +57,7 @@ async fn get_shares_by_namespace() {
 
 #[tokio::test]
 async fn get_shares_by_namespace_forbidden() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let header = client.header_network_head().await.unwrap();
 
     // those namespaces are forbidden in celestia-node's implementation
@@ -71,7 +71,7 @@ async fn get_shares_by_namespace_forbidden() {
 
 #[tokio::test]
 async fn get_shares_range() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(1024);
     let blob = Blob::new(namespace, data.clone(), AppVersion::V2).unwrap();
@@ -106,7 +106,7 @@ async fn get_shares_range() {
 
 #[tokio::test]
 async fn get_shares_range_not_existing() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let header = client.header_network_head().await.unwrap();
     let shares_in_block = header.dah.square_width().pow(2);
 
@@ -122,7 +122,7 @@ async fn get_shares_range_not_existing() {
 
 #[tokio::test]
 async fn get_shares_range_ignores_parity() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let namespace = random_ns();
     let data = random_bytes(100);
@@ -141,7 +141,7 @@ async fn get_shares_range_ignores_parity() {
 
 #[tokio::test]
 async fn get_shares_by_namespace_wrong_ns() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(1024);
     let blob = Blob::new(namespace, data.clone(), AppVersion::V2).unwrap();
@@ -182,7 +182,7 @@ async fn get_shares_by_namespace_wrong_ns() {
 
 #[tokio::test]
 async fn get_shares_by_namespace_wrong_ns_out_of_range() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(1024);
     let blob = Blob::new(namespace, data.clone(), AppVersion::V2).unwrap();
@@ -208,7 +208,7 @@ async fn get_shares_by_namespace_wrong_ns_out_of_range() {
 
 #[tokio::test]
 async fn get_shares_by_namespace_wrong_roots() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(1024);
     let blob = Blob::new(namespace, data.clone(), AppVersion::V2).unwrap();
@@ -227,7 +227,7 @@ async fn get_shares_by_namespace_wrong_roots() {
 
 #[tokio::test]
 async fn get_eds() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = vec![1, 2, 3, 4];
     let blob = Blob::new(namespace, data.clone(), AppVersion::V2).unwrap();
diff --git a/rpc/tests/state.rs b/rpc/tests/state.rs
index b1e40352d..5ce078144 100644
--- a/rpc/tests/state.rs
+++ b/rpc/tests/state.rs
@@ -11,20 +11,20 @@ use crate::utils::client::{new_test_client, AuthLevel};
 
 #[tokio::test]
 async fn account_address() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let _addr = client.state_account_address().await.unwrap();
 }
 
 #[tokio::test]
 async fn balance() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let balance = client.state_balance().await.unwrap();
     assert_eq!(balance.denom, "utia");
 }
 
 #[tokio::test]
 async fn balance_for_address() {
-    let client = new_test_client(AuthLevel::Read).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
 
     let my_addr = client.state_account_address().await.unwrap();
     let my_balance = client.state_balance().await.unwrap();
@@ -35,7 +35,7 @@ async fn balance_for_address() {
 
 #[tokio::test]
 async fn submit_pay_for_blob() {
-    let client = new_test_client(AuthLevel::Write).await.unwrap();
+    let client = new_test_client(AuthLevel::Skip).await.unwrap();
     let namespace = random_ns();
     let data = random_bytes(5);
     let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
diff --git a/rpc/tests/utils/client.rs b/rpc/tests/utils/client.rs
index 32c628490..36a952c16 100644
--- a/rpc/tests/utils/client.rs
+++ b/rpc/tests/utils/client.rs
@@ -21,7 +21,7 @@ async fn write_lock() -> MutexGuard<'static, ()> {
 
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 pub enum AuthLevel {
-    Public,
+    Skip,
     Read,
     Write,
     Admin,
@@ -29,7 +29,7 @@ pub enum AuthLevel {
 
 fn token_from_env(auth_level: AuthLevel) -> Result<Option<String>> {
     match auth_level {
-        AuthLevel::Public => Ok(None),
+        AuthLevel::Skip => Ok(None),
         AuthLevel::Read => Ok(Some(env::var("CELESTIA_NODE_AUTH_TOKEN_READ")?)),
         AuthLevel::Write => Ok(Some(env::var("CELESTIA_NODE_AUTH_TOKEN_WRITE")?)),
         AuthLevel::Admin => Ok(Some(env::var("CELESTIA_NODE_AUTH_TOKEN_ADMIN")?)),
@@ -40,10 +40,13 @@ fn env_or(var_name: &str, or_value: &str) -> String {
     env::var(var_name).unwrap_or_else(|_| or_value.to_owned())
 }
 
-pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+pub async fn new_test_client_with_url(
+    auth_level: AuthLevel,
+    celestia_rpc_url: &str,
+) -> Result<Client> {
     let _ = dotenvy::dotenv();
     let token = token_from_env(auth_level)?;
-    let url = env_or("CELESTIA_RPC_URL", CELESTIA_RPC_URL);
+    let url = env_or("CELESTIA_RPC_URL", celestia_rpc_url);
 
     let client = Client::new(&url, token.as_deref()).await?;
 
@@ -54,6 +57,10 @@ pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
     Ok(client)
 }
 
+pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
+}
+
 pub async fn blob_submit<C>(client: &C, blobs: &[Blob]) -> Result<u64, ClientError>
 where
     C: SubscriptionClientT + Sync,


Reviews:
user: login: fl0rek
body: @YakupAltay thanks! Left few nits, otherwise looks good. 🎸 
Our swift CI is currently flaky, I'll look into that. Until then please restart the failed builds (or ping us? Not sure about permissions), they usually pass on the second attempt.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-28T12:24:56Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-28T21:43:36Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-28T23:19:07Z
user: login: oblique
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T11:04:33Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T12:31:42Z
user: login: fl0rek
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T06:13:10Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T09:12:13Z
user: login: oblique
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T10:02:51Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T10:20:05Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T10:25:05Z
user: login: oblique
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T10:45:07Z
user: login: oblique
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T10:46:12Z
user: login: oblique
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T11:10:30Z
user: login: oblique
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T11:17:51Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T11:43:34Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T11:53:59Z
user: login: oblique
body: LGTM. Thanks!
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T12:11:24Z
user: login: zvolin
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-03T12:18:18Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T12:24:47Z
user: login: zvolin
body: LGTM, just want some change in the auth token tests
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-03T12:28:17Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T13:23:48Z
user: login: YakupAltay
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T13:52:39Z
user: login: oblique
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T14:17:55Z
user: login: zvolin
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-03T14:19:53Z

Review comments:
diff_hunk: @@ -38,10 +38,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
     env::var(var_name).unwrap_or_else(|_| or_value.to_owned())
 }
 
-pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+pub async fn new_test_client(
path: rpc/tests/utils/client.rs
user: login: fl0rek
body: I don't love having to put `None` almost everywhere, since it's not obvious that it means 'use default'. Maybe we could have a pair `new_test_client` and `new_test_client_with_url` to parametrise the URL? That too could get messy with more params, but in this case it like it more. 
@zvolin @oblique thoughts?
created_at: 2025-03-28T12:16:18Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client(AuthLevel::Write, Some(CELESTIA_BRIDGE_RPC_URL))
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
+
+    let dah = client
+        .header_get_by_height(submitted_height)
+        .await
+        .unwrap()
+        .dah;
+    let root_hash = dah.row_root(0).unwrap();
+
+    let received_blob = client
+        .blob_get(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    received_blob.validate(AppVersion::V2).unwrap();
+    assert_blob_equal_to_sent(&received_blob, &blob);
+
+    let proofs = client
+        .blob_get_proof(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    assert_eq!(proofs.len(), 1);
+
+    let leaves = blob.to_shares().unwrap();
+
+    proofs[0]
+        .verify_complete_namespace(&root_hash, &leaves, namespace.into())
+        .unwrap();
+}
+
+/// Blobs received from chain have index field set, so to
+/// compare if they are equal to the ones we sent, we need
+/// to overwrite the index field with received one.
path: rpc/tests/auth_token.rs
user: login: fl0rek
body: nit: I think this should be normal comment 
created_at: 2025-03-28T12:18:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client(AuthLevel::Write, Some(CELESTIA_BRIDGE_RPC_URL))
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
+
+    let dah = client
+        .header_get_by_height(submitted_height)
+        .await
+        .unwrap()
+        .dah;
+    let root_hash = dah.row_root(0).unwrap();
+
+    let received_blob = client
+        .blob_get(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    received_blob.validate(AppVersion::V2).unwrap();
+    assert_blob_equal_to_sent(&received_blob, &blob);
+
+    let proofs = client
+        .blob_get_proof(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    assert_eq!(proofs.len(), 1);
+
+    let leaves = blob.to_shares().unwrap();
+
+    proofs[0]
+        .verify_complete_namespace(&root_hash, &leaves, namespace.into())
+        .unwrap();
+}
+
+/// Blobs received from chain have index field set, so to
+/// compare if they are equal to the ones we sent, we need
+/// to overwrite the index field with received one.
path: rpc/tests/auth_token.rs
user: login: YakupAltay
body: I took that function and the comments directly from `rpc/tests/blob.rs` by the way.

But I think I can fix it.
created_at: 2025-03-28T21:43:36Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,10 +38,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
     env::var(var_name).unwrap_or_else(|_| or_value.to_owned())
 }
 
-pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+pub async fn new_test_client(
path: rpc/tests/utils/client.rs
user: login: YakupAltay
body: I have now both `new_test_client` and `new_test_client_with_url` passing the tests. But I have not committed them yet.

If you have another idea, I would love to implement it.
created_at: 2025-03-28T23:19:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,10 +38,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
     env::var(var_name).unwrap_or_else(|_| or_value.to_owned())
 }
 
-pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+pub async fn new_test_client(
path: rpc/tests/utils/client.rs
user: login: oblique
body: I like the `new_test_client`  `new_test_client_with_url`. Push that
created_at: 2025-04-02T11:04:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,10 +38,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
     env::var(var_name).unwrap_or_else(|_| or_value.to_owned())
 }
 
-pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+pub async fn new_test_client(
path: rpc/tests/utils/client.rs
user: login: YakupAltay
body: Pushed it! 🫡
created_at: 2025-04-02T12:31:42Z
author_association: CONTRIBUTOR
diff_hunk: @@ -51,6 +51,22 @@ pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
     Ok(client)
 }
 
+pub async fn new_test_client_with_url(
path: rpc/tests/utils/client.rs
user: login: fl0rek
body: `new_test_client` could be implemented in terms of `new_test_client_with_url` with `CELESTIA_RPC_URL` passed. I don't think it'd have any knock-on effects?
created_at: 2025-04-03T06:13:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -51,6 +51,22 @@ pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
     Ok(client)
 }
 
+pub async fn new_test_client_with_url(
path: rpc/tests/utils/client.rs
user: login: YakupAltay
body: Yes, I tested it and it worked.

You can check out my last commit.
created_at: 2025-04-03T09:12:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -39,9 +39,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
 }
 
 pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
path: rpc/tests/utils/client.rs
user: login: oblique
body: I think we still need to do the `env_or` otherwise we will not be able to override url from env.

```suggestion
    let url = env_or("CELESTIA_RPC_URL", CELESTIA_RPC_URL);
    new_test_client_with_url(auth_level, &url).await
```
created_at: 2025-04-03T10:02:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -39,9 +39,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
 }
 
 pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
path: rpc/tests/utils/client.rs
user: login: YakupAltay
body: Oh, sorry about that. I did not think of it.

You can view the change in the latest commit.
created_at: 2025-04-03T10:20:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -39,9 +39,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
 }
 
 pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
path: rpc/tests/utils/client.rs
user: login: YakupAltay
body: Also, I could not understand why some tests failed. Could you please check, @oblique?
created_at: 2025-04-03T10:25:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -39,9 +39,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
 }
 
 pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
path: rpc/tests/utils/client.rs
user: login: oblique
body: actually i was wrong, sorry i wasn't thinking straight. `env_or` is not needed. 😅

about the tests: they fail because new Rust just got released and they introduce new clippy lints.
created_at: 2025-04-03T10:45:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -39,9 +39,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
 }
 
 pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
path: rpc/tests/utils/client.rs
user: login: oblique
body: i will fix them and open a PR
created_at: 2025-04-03T10:46:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -39,9 +39,16 @@ fn env_or(var_name: &str, or_value: &str) -> String {
 }
 
 pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
path: rpc/tests/utils/client.rs
user: login: oblique
body: ok so I opened #594 for the clippy issue. the test-wasm looks like a temporary issue,
created_at: 2025-04-03T11:10:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -54,6 +57,11 @@ pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
     Ok(client)
 }
 
+pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    let url = env_or("CELESTIA_RPC_URL", CELESTIA_RPC_URL);
+    new_test_client_with_url(auth_level, &url).await
path: rpc/tests/utils/client.rs
user: login: oblique
body: sorry i wasn't thinking straight when i said `env_or` is needed.
your previous code was correct.

```suggestion
    new_test_client_with_url(auth_level, CELESTIA_RPC_URL).await
```
created_at: 2025-04-03T11:17:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client(AuthLevel::Write, Some(CELESTIA_BRIDGE_RPC_URL))
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
+
+    let dah = client
+        .header_get_by_height(submitted_height)
+        .await
+        .unwrap()
+        .dah;
+    let root_hash = dah.row_root(0).unwrap();
+
+    let received_blob = client
+        .blob_get(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    received_blob.validate(AppVersion::V2).unwrap();
+    assert_blob_equal_to_sent(&received_blob, &blob);
+
+    let proofs = client
+        .blob_get_proof(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    assert_eq!(proofs.len(), 1);
+
+    let leaves = blob.to_shares().unwrap();
+
+    proofs[0]
+        .verify_complete_namespace(&root_hash, &leaves, namespace.into())
+        .unwrap();
+}
+
+/// Blobs received from chain have index field set, so to
+/// compare if they are equal to the ones we sent, we need
+/// to overwrite the index field with received one.
path: rpc/tests/auth_token.rs
user: login: YakupAltay
body: Can we say that this is resolved or should I make them normal comment?
created_at: 2025-04-03T11:43:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -54,6 +57,11 @@ pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
     Ok(client)
 }
 
+pub async fn new_test_client(auth_level: AuthLevel) -> Result<Client> {
+    let url = env_or("CELESTIA_RPC_URL", CELESTIA_RPC_URL);
+    new_test_client_with_url(auth_level, &url).await
path: rpc/tests/utils/client.rs
user: login: YakupAltay
body: Oh, okay!

Pushed it now.
created_at: 2025-04-03T11:53:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client(AuthLevel::Write, Some(CELESTIA_BRIDGE_RPC_URL))
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
+
+    let dah = client
+        .header_get_by_height(submitted_height)
+        .await
+        .unwrap()
+        .dah;
+    let root_hash = dah.row_root(0).unwrap();
+
+    let received_blob = client
+        .blob_get(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    received_blob.validate(AppVersion::V2).unwrap();
+    assert_blob_equal_to_sent(&received_blob, &blob);
+
+    let proofs = client
+        .blob_get_proof(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    assert_eq!(proofs.len(), 1);
+
+    let leaves = blob.to_shares().unwrap();
+
+    proofs[0]
+        .verify_complete_namespace(&root_hash, &leaves, namespace.into())
+        .unwrap();
+}
+
+/// Blobs received from chain have index field set, so to
+/// compare if they are equal to the ones we sent, we need
+/// to overwrite the index field with received one.
path: rpc/tests/auth_token.rs
user: login: zvolin
body: either way works, I think it was also just copy pasted as I recall this code :p 
created_at: 2025-04-03T12:18:18Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client_with_url, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client_with_url(AuthLevel::Write, CELESTIA_BRIDGE_RPC_URL)
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
+
+    let dah = client
+        .header_get_by_height(submitted_height)
+        .await
+        .unwrap()
+        .dah;
+    let root_hash = dah.row_root(0).unwrap();
+
+    let received_blob = client
+        .blob_get(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    received_blob.validate(AppVersion::V2).unwrap();
+    assert_blob_equal_to_sent(&received_blob, &blob);
+
+    let proofs = client
+        .blob_get_proof(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    assert_eq!(proofs.len(), 1);
+
+    let leaves = blob.to_shares().unwrap();
+
+    proofs[0]
+        .verify_complete_namespace(&root_hash, &leaves, namespace.into())
+        .unwrap();
+}
+
+/// Blobs received from chain have index field set, so to
+/// compare if they are equal to the ones we sent, we need
+/// to overwrite the index field with received one.
+#[track_caller]
+fn assert_blob_equal_to_sent(received: &Blob, sent: &Blob) {
+    let mut sent = sent.clone();
+    sent.index = received.index;
+    assert_eq!(&sent, received);
+}
path: rpc/tests/auth_token.rs
user: login: zvolin
body: ```suggestion
```
created_at: 2025-04-03T12:23:03Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client_with_url, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client_with_url(AuthLevel::Write, CELESTIA_BRIDGE_RPC_URL)
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
+
+    let dah = client
+        .header_get_by_height(submitted_height)
+        .await
+        .unwrap()
+        .dah;
+    let root_hash = dah.row_root(0).unwrap();
+
+    let received_blob = client
+        .blob_get(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    received_blob.validate(AppVersion::V2).unwrap();
+    assert_blob_equal_to_sent(&received_blob, &blob);
+
+    let proofs = client
+        .blob_get_proof(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    assert_eq!(proofs.len(), 1);
+
+    let leaves = blob.to_shares().unwrap();
+
+    proofs[0]
+        .verify_complete_namespace(&root_hash, &leaves, namespace.into())
+        .unwrap();
path: rpc/tests/auth_token.rs
user: login: zvolin
body: ```suggestion
```
created_at: 2025-04-03T12:23:51Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client(AuthLevel::Write, Some(CELESTIA_BRIDGE_RPC_URL))
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
+
+    let dah = client
+        .header_get_by_height(submitted_height)
+        .await
+        .unwrap()
+        .dah;
+    let root_hash = dah.row_root(0).unwrap();
+
+    let received_blob = client
+        .blob_get(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    received_blob.validate(AppVersion::V2).unwrap();
+    assert_blob_equal_to_sent(&received_blob, &blob);
+
+    let proofs = client
+        .blob_get_proof(submitted_height, namespace, blob.commitment)
+        .await
+        .unwrap();
+
+    assert_eq!(proofs.len(), 1);
+
+    let leaves = blob.to_shares().unwrap();
+
+    proofs[0]
+        .verify_complete_namespace(&root_hash, &leaves, namespace.into())
+        .unwrap();
+}
+
+/// Blobs received from chain have index field set, so to
+/// compare if they are equal to the ones we sent, we need
+/// to overwrite the index field with received one.
path: rpc/tests/auth_token.rs
user: login: YakupAltay
body: This is the way, haha
created_at: 2025-04-03T12:24:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client_with_url, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client_with_url(AuthLevel::Write, CELESTIA_BRIDGE_RPC_URL)
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
path: rpc/tests/auth_token.rs
user: login: zvolin
body: ```suggestion
    let namespace = random_ns();
    let data = random_bytes(5);
    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();

    for auth_level in [AuthLevel::Skip, AuthLevel::Read] {
        let unauthorized_client = new_test_client_with_url(auth_level, CELESTIA_BRIDGE_RPC_URL)
            .await
            .unwrap();

        blob_submit(&unauthorized_client, &[blob.clone()]).await.unwrap_err();
    }
    
    for auth_level in [AuthLevel::Write, AuthLevel::Admin] {
        let authorized_client = new_test_client_with_url(auth_level, CELESTIA_BRIDGE_RPC_URL)
            .await
            .unwrap();

        blob_submit(&authorized_client, &[blob.clone()]).await.unwrap();
    }
```
created_at: 2025-04-03T12:26:50Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client_with_url, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client_with_url(AuthLevel::Write, CELESTIA_BRIDGE_RPC_URL)
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
path: rpc/tests/auth_token.rs
user: login: zvolin
body: I think this test doesn't need to test blob submission but rather just if permissions works as expected. Posted a few suggestions in this file that basically all apply to this single comment
created_at: 2025-04-03T12:27:53Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client_with_url, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client_with_url(AuthLevel::Write, CELESTIA_BRIDGE_RPC_URL)
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
path: rpc/tests/auth_token.rs
user: login: YakupAltay
body: I think we have a problem here.

`client.header_network_head()` at _/rpc/tests/client.rs_ gives authentication error for `AuthLevel::Skip`. So, we cannot directly use `new_test_client_with_url` with that auth level.

What do you suggest for it?
created_at: 2025-04-03T13:23:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,63 @@
+#![cfg(not(target_arch = "wasm32"))]
+
+use celestia_rpc::prelude::*;
+use celestia_types::consts::appconsts::AppVersion;
+use celestia_types::Blob;
+
+pub mod utils;
+
+use crate::utils::client::{blob_submit, new_test_client_with_url, AuthLevel};
+use crate::utils::{random_bytes, random_ns};
+
+// Use node-1 (bridge node) as the RPC URL
+const CELESTIA_BRIDGE_RPC_URL: &str = "ws://localhost:36658";
+
+#[tokio::test]
+async fn blob_submit_and_get_using_bridge_node() {
+    let client = new_test_client_with_url(AuthLevel::Write, CELESTIA_BRIDGE_RPC_URL)
+        .await
+        .unwrap();
+    let namespace = random_ns();
+    let data = random_bytes(5);
+    let blob = Blob::new(namespace, data, AppVersion::V2).unwrap();
+
+    let submitted_height = blob_submit(&client, &[blob.clone()]).await.unwrap();
path: rpc/tests/auth_token.rs
user: login: YakupAltay
body: Just committed a change for that, @zvolin. It's not clean enough but it's a way, haha.
created_at: 2025-04-03T13:52:39Z
author_association: CONTRIBUTOR

PR comments:
user: login: YakupAltay
created_at: 2025-03-26T16:29:02Z
body: Would love to have your inputs on the Swift tests, @zvolin & @fl0rek!

I could not find how my changes affected it.
author_association: CONTRIBUTOR
user: login: YakupAltay
created_at: 2025-04-02T09:45:35Z
body: Do you have any updates guys, @fl0rek & @zvolin?
author_association: CONTRIBUTOR
user: login: zvolin
created_at: 2025-04-03T12:32:56Z
body: btw sorry for late review but last week we were all on a retreat and this week I'm bit sick, thanks for the patience :+1: 
author_association: COLLABORATOR
user: login: YakupAltay
created_at: 2025-04-03T13:20:12Z
body: That's okay. I hope you're feeling better.
author_association: CONTRIBUTOR