Skip to content

Commit

Permalink
new rust, more CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0rek committed Nov 29, 2024
1 parent a8a1b20 commit 8307ddc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion grpc/tests/tonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use celestia_types::blob::MsgPayForBlobs;
use celestia_types::nmt::Namespace;
use celestia_types::{AppVersion, Blob};

pub mod utils;
mod utils;

use crate::utils::{load_account, new_test_client};

Expand Down
7 changes: 4 additions & 3 deletions grpc/tests/utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]
//! Utilities for grpc tests
use std::{env, fs};

Expand Down Expand Up @@ -51,11 +52,11 @@ impl TestAuthInterceptor {
}
}

pub fn env_or(var_name: &str, or_value: &str) -> String {
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() -> Result<GrpcClient<TestAuthInterceptor>> {
pub(crate) async fn new_test_client() -> Result<GrpcClient<TestAuthInterceptor>> {
let _ = dotenvy::dotenv();
let url = env_or("CELESTIA_GRPC_URL", CELESTIA_GRPC_URL);
let grpc_channel = Channel::from_shared(url)?.connect().await?;
Expand All @@ -64,7 +65,7 @@ pub async fn new_test_client() -> Result<GrpcClient<TestAuthInterceptor>> {
Ok(GrpcClient::new(grpc_channel, auth_interceptor))
}

pub fn load_account(path: &str) -> TestAccount {
pub(crate) fn load_account(path: &str) -> TestAccount {
let account_file = format!("{path}.addr");
let key_file = format!("{path}.plaintext-key");

Expand Down
2 changes: 1 addition & 1 deletion node/src/block_ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(crate) trait BlockRangeExt {

pub(crate) struct BlockRangeDisplay<'a>(&'a RangeInclusive<u64>);

impl<'a> Display for BlockRangeDisplay<'a> {
impl Display for BlockRangeDisplay<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}-{}", self.0.start(), self.0.end())
}
Expand Down
2 changes: 1 addition & 1 deletion node/src/store/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl From<ExtendedHeader> for VerifiedExtendedHeaders {
}
}

impl<'a> From<&'a ExtendedHeader> for VerifiedExtendedHeaders {
impl From<&ExtendedHeader> for VerifiedExtendedHeaders {
fn from(value: &ExtendedHeader) -> Self {
Self(vec![value.to_owned()])
}
Expand Down

0 comments on commit 8307ddc

Please sign in to comment.