diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 7bffd9e169159ed572901d19878751b4d00e0f6f..79f2b5e9092c28f18dd07bf11bfb90fb9cfe6e45 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -9621,7 +9621,6 @@ dependencies = [ "libp2p", "log", "parity-scale-codec", - "pin-project", "sc-network", "sc-network-common", "sc-peerset", diff --git a/substrate/client/network/transactions/Cargo.toml b/substrate/client/network/transactions/Cargo.toml index 3ae1dc5908df47fca09ba9c2a6096abcd7a6c0e5..868e5cdc1b8c96198c3e39e044c0de92c3697d26 100644 --- a/substrate/client/network/transactions/Cargo.toml +++ b/substrate/client/network/transactions/Cargo.toml @@ -18,7 +18,6 @@ codec = { package = "parity-scale-codec", version = "3.2.2", features = ["derive futures = "0.3.21" libp2p = "0.51.3" log = "0.4.17" -pin-project = "1.0.12" prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../../utils/prometheus" } sc-network = { version = "0.10.0-dev", path = "../" } sc-network-common = { version = "0.10.0-dev", path = "../common" } diff --git a/substrate/client/network/transactions/src/lib.rs b/substrate/client/network/transactions/src/lib.rs index f57556d3986b0522617c8660e1f3ee6c9623fb9e..ca9fc63b6f83f391d4bc6d55d4840481a941f268 100644 --- a/substrate/client/network/transactions/src/lib.rs +++ b/substrate/client/network/transactions/src/lib.rs @@ -97,21 +97,19 @@ impl Metrics { } } -#[pin_project::pin_project] struct PendingTransaction<H> { - #[pin] validation: TransactionImportFuture, tx_hash: H, } +impl<H> Unpin for PendingTransaction<H> {} + impl<H: ExHashT> Future for PendingTransaction<H> { type Output = (H, TransactionImport); - fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { - let mut this = self.project(); - - if let Poll::Ready(import_result) = Pin::new(&mut this.validation).poll_unpin(cx) { - return Poll::Ready((this.tx_hash.clone(), import_result)) + fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { + if let Poll::Ready(import_result) = self.validation.poll_unpin(cx) { + return Poll::Ready((self.tx_hash.clone(), import_result)) } Poll::Pending