Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make transaction status stream work #1108

Merged
merged 11 commits into from
May 29, 2023
161 changes: 143 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ serde_json = "1.0"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "cookies"] }
mockall = "0.11"
test-case = "2.2"
test-strategy = "0.3"
proptest = "1.1"
axum = "0.5"
lazy_static = "1.4"
once_cell = "1.16"
Expand Down
2 changes: 2 additions & 0 deletions crates/fuel-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ fuel-core-storage = { path = "./../storage", features = ["test-helpers"] }
fuel-core-trace = { path = "./../trace" }
fuel-core-types = { path = "./../types", features = ["test-helpers"] }
mockall = { workspace = true }
proptest = { workspace = true }
test-case = { workspace = true }
test-strategy = { workspace = true }

[features]
dap = ["dep:uuid"]
Expand Down
11 changes: 7 additions & 4 deletions crates/fuel-core/src/graphql_api/ports.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use async_trait::async_trait;
use fuel_core_services::stream::BoxStream;
use fuel_core_services::stream::{
BoxFuture,
BoxStream,
};
use fuel_core_storage::{
iter::{
BoxedIter,
Expand All @@ -21,7 +24,7 @@ use fuel_core_storage::{
Result as StorageResult,
StorageInspect,
};
use fuel_core_txpool::service::TxUpdate;
use fuel_core_txpool::service::TxStatusMessage;
use fuel_core_types::{
blockchain::primitives::{
BlockId,
Expand Down Expand Up @@ -55,7 +58,6 @@ use fuel_core_types::{
tai64::Tai64,
};
use std::sync::Arc;
use tokio_stream::wrappers::errors::BroadcastStreamRecvError;

/// The database port expected by GraphQL API service.
pub trait DatabasePort:
Expand Down Expand Up @@ -161,7 +163,8 @@ pub trait TxPoolPort: Send + Sync {

fn tx_update_subscribe(
&self,
) -> BoxStream<anyhow::Result<TxUpdate, BroadcastStreamRecvError>>;
tx_id: TxId,
) -> BoxFuture<'_, BoxStream<TxStatusMessage>>;
}

#[async_trait]
Expand Down
Loading