pub struct BasicPool<PoolApi, Block>where
    Block: BlockT,
    PoolApi: ChainApi<Block = Block>,{ /* private fields */ }
Expand description

Basic implementation of transaction pool that can be customized by providing PoolApi.

Implementations§

source§

impl<PoolApi, Block> BasicPool<PoolApi, Block>where Block: BlockT, PoolApi: ChainApi<Block = Block> + 'static,

source

pub fn new_test( pool_api: Arc<PoolApi>, best_block_hash: Block::Hash, finalized_hash: Block::Hash ) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>)

Create new basic transaction pool with provided api, for tests.

source

pub fn with_revalidation_type( options: Options, is_validator: IsValidator, pool_api: Arc<PoolApi>, prometheus: Option<&PrometheusRegistry>, revalidation_type: RevalidationType, spawner: impl SpawnEssentialNamed, best_block_number: NumberFor<Block>, best_block_hash: Block::Hash, finalized_hash: Block::Hash ) -> Self

Create new basic transaction pool with provided api and custom revalidation type.

source

pub fn pool(&self) -> &Arc<Pool<PoolApi>>

Gets shared reference to the underlying pool.

source

pub fn api(&self) -> &PoolApi

Get access to the underlying api

source§

impl<Block, Client> BasicPool<FullChainApi<Client, Block>, Block>where Block: BlockT, Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + ExecutorProvider<Block> + UsageProvider<Block> + HeaderMetadata<Block, Error = Error> + Send + Sync + 'static, Client::Api: TaggedTransactionQueue<Block>,

source

pub fn new_full( options: Options, is_validator: IsValidator, prometheus: Option<&PrometheusRegistry>, spawner: impl SpawnEssentialNamed, client: Arc<Client> ) -> Arc<Self>

Create new basic transaction pool for a full node with the provided api.

Trait Implementations§

source§

impl<Block, Client> LocalTransactionPool for BasicPool<FullChainApi<Client, Block>, Block>where Block: BlockT, Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + HeaderMetadata<Block, Error = Error> + Send + Sync + 'static, Client::Api: TaggedTransactionQueue<Block>,

§

type Block = Block

Block type.
§

type Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash

Transaction hash type.
§

type Error = <FullChainApi<Client, Block> as ChainApi>::Error

Error type.
source§

fn submit_local( &self, at: Block::Hash, xt: LocalTransactionFor<Self> ) -> Result<Self::Hash, Self::Error>

Submits the given local unverified transaction to the pool blocking the current thread for any necessary pre-verification. NOTE: It MUST NOT be used for transactions that originate from the network or RPC, since the validation is performed with TransactionSource::Local.
source§

impl<PoolApi, Block> MaintainedTransactionPool for BasicPool<PoolApi, Block>where Block: BlockT, PoolApi: 'static + ChainApi<Block = Block>,

source§

fn maintain<'life0, 'async_trait>( &'life0 self, event: ChainEvent<Self::Block> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Perform maintenance
source§

impl<PoolApi, Block> TransactionPool for BasicPool<PoolApi, Block>where Block: BlockT, PoolApi: 'static + ChainApi<Block = Block>,

§

type Block = <PoolApi as ChainApi>::Block

Block type.
§

type Hash = <<PoolApi as ChainApi>::Block as Block>::Hash

Transaction hash type.
§

type InPoolTransaction = Transaction<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic>

In-pool transaction type.
§

type Error = <PoolApi as ChainApi>::Error

Error type.
source§

fn submit_at( &self, at: &BlockId<Self::Block>, source: TransactionSource, xts: Vec<TransactionFor<Self>> ) -> PoolFuture<Vec<Result<TxHash<Self>, Self::Error>>, Self::Error>

Returns a future that imports a bunch of unverified transactions to the pool.
source§

fn submit_one( &self, at: &BlockId<Self::Block>, source: TransactionSource, xt: TransactionFor<Self> ) -> PoolFuture<TxHash<Self>, Self::Error>

Returns a future that imports one unverified transaction to the pool.
source§

fn submit_and_watch( &self, at: &BlockId<Self::Block>, source: TransactionSource, xt: TransactionFor<Self> ) -> PoolFuture<Pin<Box<TransactionStatusStreamFor<Self>>>, Self::Error>

Returns a future that import a single transaction and starts to watch their progress in the pool.
source§

fn remove_invalid( &self, hashes: &[TxHash<Self>] ) -> Vec<Arc<Self::InPoolTransaction>>

Remove transactions identified by given hashes (and dependent transactions) from the pool.
source§

fn status(&self) -> PoolStatus

Returns pool status.
source§

fn import_notification_stream(&self) -> ImportNotificationStream<TxHash<Self>>

Return an event stream of transactions imported to the pool.
source§

fn hash_of(&self, xt: &TransactionFor<Self>) -> TxHash<Self>

Returns transaction hash
source§

fn on_broadcasted(&self, propagations: HashMap<TxHash<Self>, Vec<String>>)

Notify the pool about transactions broadcast.
source§

fn ready_transaction( &self, hash: &TxHash<Self> ) -> Option<Arc<Self::InPoolTransaction>>

Return specific ready transaction by hash, if there is one.
source§

fn ready_at( &self, at: NumberFor<Self::Block> ) -> Pin<Box<dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Transaction<<<PoolApi as ChainApi>::Block as Block>::Hash, <<PoolApi as ChainApi>::Block as Block>::Extrinsic>>> + Send>> + Send>>

Get an iterator for ready transactions ordered by priority. Read more
source§

fn ready( &self ) -> Box<dyn ReadyTransactions<Item = Arc<Transaction<<<PoolApi as ChainApi>::Block as Block>::Hash, <<PoolApi as ChainApi>::Block as Block>::Extrinsic>>> + Send>

Get an iterator for ready transactions ordered by priority.

Auto Trait Implementations§

§

impl<PoolApi, Block> !RefUnwindSafe for BasicPool<PoolApi, Block>

§

impl<PoolApi, Block> Send for BasicPool<PoolApi, Block>

§

impl<PoolApi, Block> Sync for BasicPool<PoolApi, Block>

§

impl<PoolApi, Block> Unpin for BasicPool<PoolApi, Block>

§

impl<PoolApi, Block> !UnwindSafe for BasicPool<PoolApi, Block>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedConversion for T

source§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
source§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatedConversion for T

source§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
source§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
source§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> JsonSchemaMaybe for T