From 2a24ab0250ce82caaef3b4594b9277a9a49656a8 Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Tue, 27 Aug 2024 17:28:12 -0300 Subject: [PATCH] fix all features --- Cargo.lock | 8 ++++---- src/sources/u5c.rs | 38 +++++++------------------------------- 2 files changed, 11 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e745f81..2a563081 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6592,9 +6592,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa 1.0.10", @@ -6613,9 +6613,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", diff --git a/src/sources/u5c.rs b/src/sources/u5c.rs index 8f8bf8c2..c091dad1 100644 --- a/src/sources/u5c.rs +++ b/src/sources/u5c.rs @@ -1,19 +1,17 @@ use futures::StreamExt; use gasket::framework::*; - -use pallas::ledger::traverse::MultiEraBlock; -use pallas::network::miniprotocols::Point; use serde::Deserialize; use tonic::transport::Channel; use tonic::Streaming; use tracing::{debug, error}; -use utxorpc_spec::utxorpc::v1alpha::sync::any_chain_block::Chain; -use utxorpc_spec::utxorpc::v1alpha::sync::chain_sync_service_client::ChainSyncServiceClient; -use utxorpc_spec::utxorpc::v1alpha::sync::follow_tip_response::Action; -use utxorpc_spec::utxorpc::v1alpha::sync::{ +use pallas::interop::utxorpc::spec::sync::any_chain_block::Chain; +use pallas::interop::utxorpc::spec::sync::follow_tip_response::Action; +use pallas::interop::utxorpc::spec::sync::sync_service_client::SyncServiceClient; +use pallas::interop::utxorpc::spec::sync::{ BlockRef, DumpHistoryRequest, FollowTipRequest, FollowTipResponse, }; +use pallas::network::miniprotocols::Point; use crate::framework::*; @@ -28,7 +26,7 @@ fn point_to_blockref(point: Point) -> Option { } pub struct Worker { - client: ChainSyncServiceClient, + client: SyncServiceClient, stream: Option>, intersect: Option, max_items_per_page: u32, @@ -57,17 +55,6 @@ impl Worker { } } } - Chain::Raw(bytes) => { - let block = MultiEraBlock::decode(bytes).or_panic()?; - - let evt = ChainEvent::Apply( - Point::Specific(block.slot(), block.hash().to_vec()), - Record::CborBlock(bytes.to_vec()), - ); - - stage.output.send(evt.into()).await.or_panic()?; - stage.chain_tip.set(block.slot() as i64); - } } } } @@ -91,17 +78,6 @@ impl Worker { } } } - Chain::Raw(bytes) => { - let block = MultiEraBlock::decode(bytes).or_panic()?; - - let evt = ChainEvent::Undo( - Point::Specific(block.slot(), block.hash().to_vec()), - Record::CborBlock(bytes.to_vec()), - ); - - stage.output.send(evt.into()).await.or_panic()?; - stage.chain_tip.set(block.slot() as i64); - } } } } @@ -183,7 +159,7 @@ impl gasket::framework::Worker for Worker { async fn bootstrap(stage: &Stage) -> Result { debug!("connecting"); - let client = ChainSyncServiceClient::connect(stage.config.url.clone()) + let client = SyncServiceClient::connect(stage.config.url.clone()) .await .or_panic()?;