Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use just ready future
Browse files Browse the repository at this point in the history
NikVolf committed Jan 22, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 44c0d23 commit d9ad04d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions client/transaction-pool/src/api.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
use std::{marker::PhantomData, pin::Pin, sync::Arc};
use codec::{Decode, Encode};
use futures::{
channel::oneshot, executor::{ThreadPool, ThreadPoolBuilder}, future::{Future, FutureExt, ready},
channel::oneshot, executor::{ThreadPool, ThreadPoolBuilder}, future::{Future, FutureExt, ready, Ready},
};

use sc_client_api::{
@@ -72,12 +72,10 @@ impl<Client, Block> sc_transaction_graph::ChainApi for FullChainApi<Client, Bloc
type Hash = Block::Hash;
type Error = error::Error;
type ValidationFuture = Pin<Box<dyn Future<Output = error::Result<TransactionValidity>> + Send>>;
type BodyFuture = Pin<Box<dyn Future<Output = error::Result<Option<Vec<<Self::Block as BlockT>::Extrinsic>>>> + Send>>;
type BodyFuture = Ready<error::Result<Option<Vec<<Self::Block as BlockT>::Extrinsic>>>>;

fn block_body(&self, id: &BlockId<Self::Block>) -> Self::BodyFuture {
Box::pin(ready(
self.client.block_body(&id).map_err(|e| error::Error::from(e))
))
ready(self.client.block_body(&id).map_err(|e| error::Error::from(e)))
}

fn validate_transaction(

0 comments on commit d9ad04d

Please sign in to comment.