Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroShkvorets authored and leoyvens committed Apr 5, 2024
1 parent 4218250 commit 4fe81c1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
21 changes: 12 additions & 9 deletions chain/ethereum/examples/firehose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@ async fn main() -> Result<(), Error> {
println!("Connecting to the stream!");
let mut stream: Streaming<firehose::Response> = match firehose
.clone()
.stream_blocks(firehose::Request {
start_block_num: 12369739,
stop_block_num: 12369739,
cursor: match &cursor {
Some(c) => c.clone(),
None => String::from(""),
.stream_blocks(
firehose::Request {
start_block_num: 12369739,
stop_block_num: 12369739,
cursor: match &cursor {
Some(c) => c.clone(),
None => String::from(""),
},
final_blocks_only: false,
..Default::default()
},
final_blocks_only: false,
..Default::default()
}, &firehose::ConnectionHeaders::new())
&firehose::ConnectionHeaders::new(),
)
.await
{
Ok(s) => s,
Expand Down
19 changes: 11 additions & 8 deletions graph/src/blockchain/firehose_block_ingestor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,17 @@ where

let result = endpoint
.clone()
.stream_blocks(firehose::Request {
// Starts at current HEAD block of the chain (viewed from Firehose side)
start_block_num: -1,
cursor: latest_cursor.clone(),
final_blocks_only: false,
transforms: self.default_transforms.iter().map(|t| t.into()).collect(),
..Default::default()
}, &firehose::ConnectionHeaders::new())
.stream_blocks(
firehose::Request {
// Starts at current HEAD block of the chain (viewed from Firehose side)
start_block_num: -1,
cursor: latest_cursor.clone(),
final_blocks_only: false,
transforms: self.default_transforms.iter().map(|t| t.into()).collect(),
..Default::default()
},
&firehose::ConnectionHeaders::new(),
)
.await;

match result {
Expand Down
5 changes: 3 additions & 2 deletions graph/src/firehose/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ use std::{
};
use tonic::codegen::InterceptedService;
use tonic::{
Request,
codegen::CompressionEncoding,
metadata::{Ascii, MetadataKey, MetadataValue},
transport::{Channel, ClientTlsConfig},
Request,
};

use super::{codec as firehose, interceptors::MetricsInterceptor, stream_client::StreamClient};
Expand Down Expand Up @@ -63,7 +63,8 @@ impl ConnectionHeaders {
}
pub fn with_deployment(mut self, deployment: DeploymentHash) -> Self {
if let Ok(deployment) = deployment.parse() {
self.0.insert("x-deployment-id".parse().unwrap(), deployment);
self.0
.insert("x-deployment-id".parse().unwrap(), deployment);
}
self
}
Expand Down

0 comments on commit 4fe81c1

Please sign in to comment.