fuel_core_interfaces::txpool

Enum TxPoolMpsc

Source
pub enum TxPoolMpsc {
    PendingNumber {
        response: Sender<usize>,
    },
    ConsumableGas {
        response: Sender<u64>,
    },
    Includable {
        response: Sender<Vec<ArcPoolTx>>,
    },
    Insert {
        txs: Vec<Arc<Transaction>>,
        response: Sender<Vec<Result<InsertionResult>>>,
    },
    Find {
        ids: Vec<TxId>,
        response: Sender<Vec<Option<TxInfo>>>,
    },
    FindOne {
        id: TxId,
        response: Sender<Option<TxInfo>>,
    },
    FindDependent {
        ids: Vec<TxId>,
        response: Sender<Vec<ArcPoolTx>>,
    },
    Remove {
        ids: Vec<TxId>,
        response: Sender<Vec<ArcPoolTx>>,
    },
    FilterByNegative {
        ids: Vec<TxId>,
        response: Sender<Vec<TxId>>,
    },
    Stop,
}
Expand description

RPC commands that can be sent to the TxPool through an MPSC channel. Responses are returned using response oneshot channel.

Variants§

§

PendingNumber

The number of pending transactions in the pool.

Fields

§response: Sender<usize>
§

ConsumableGas

The amount of gas in all includable transactions combined

Fields

§response: Sender<u64>
§

Includable

Return all sorted transactions that are includable in next block. This is going to be heavy operation, use it only when needed.

Fields

§response: Sender<Vec<ArcPoolTx>>
§

Insert

import list of transaction into txpool. All needed parents need to be known and parent->child order should be enforced in Vec, we will not do that check inside txpool and will just drop child and include only parent. Additional restrain is that child gas_price needs to be lower then parent gas_price. Transaction can be received from p2p RespondTransactions or from userland. Because of userland we are returning error for every insert for better user experience.

§

Find

find all tx by their hash

Fields

§ids: Vec<TxId>
§response: Sender<Vec<Option<TxInfo>>>
§

FindOne

find one tx by its hash

Fields

§id: TxId
§response: Sender<Option<TxInfo>>
§

FindDependent

find all dependent tx and return them with requested dependencies in one list sorted by Price.

Fields

§ids: Vec<TxId>
§response: Sender<Vec<ArcPoolTx>>
§

Remove

remove transaction from pool needed on user demand. Low priority

Fields

§ids: Vec<TxId>
§response: Sender<Vec<ArcPoolTx>>
§

FilterByNegative

Iterate over hashes and return all hashes that we don’t have. Needed when we receive list of new hashed from peer with BroadcastTransactionHashes, so txpool needs to return tx that we don’t have, and request them from that particular peer.

Fields

§ids: Vec<TxId>
§response: Sender<Vec<TxId>>
§

Stop

stop txpool

Trait Implementations§

Source§

impl Debug for TxPoolMpsc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

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 T
where U: From<T>,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<'a, T> StorageAsMut for T

Source§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>
where Type: Mappable,

Source§

impl<'a, T> StorageAsRef for T

Source§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>
where Type: Mappable,

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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