chore: regenerate umbrella crate, fix feature propagation
This commit is contained in:
@@ -24,9 +24,9 @@ pub mod error;
|
||||
use async_trait::async_trait;
|
||||
use codec::Codec;
|
||||
use futures::Stream;
|
||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
use pezsp_core::offchain::TransactionPoolExt;
|
||||
use pezsp_runtime::traits::{Block as BlockT, Member};
|
||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
use std::{collections::HashMap, hash::Hash, marker::PhantomData, pin::Pin, sync::Arc};
|
||||
|
||||
const LOG_TARGET: &str = "txpool::api";
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use async_trait::async_trait;
|
||||
use bizinikiwi_test_runtime::{AccountId, Block, Extrinsic, ExtrinsicBuilder, TransferData, H256};
|
||||
use codec::Encode;
|
||||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use futures::executor::block_on;
|
||||
@@ -32,7 +33,6 @@ use pezsp_runtime::{
|
||||
},
|
||||
};
|
||||
use std::sync::Arc;
|
||||
use bizinikiwi_test_runtime::{AccountId, Block, Extrinsic, ExtrinsicBuilder, TransferData, H256};
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
struct TestApi {
|
||||
|
||||
@@ -25,10 +25,10 @@ use crate::{
|
||||
single_state_txpool::BasicPool as SingleStateFullPool,
|
||||
TransactionPoolWrapper, LOG_TARGET,
|
||||
};
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use pezsc_transaction_pool_api::{LocalTransactionPool, MaintainedTransactionPool};
|
||||
use pezsp_core::traits::SpawnEssentialNamed;
|
||||
use pezsp_runtime::traits::Block as BlockT;
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use std::{marker::PhantomData, sync::Arc, time::Duration};
|
||||
|
||||
/// The type of transaction pool.
|
||||
|
||||
@@ -26,7 +26,6 @@ use crate::{
|
||||
use async_trait::async_trait;
|
||||
use codec::Encode;
|
||||
use futures::future::{Future, FutureExt};
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use pezsc_client_api::{blockchain::HeaderBackend, BlockBackend};
|
||||
use pezsp_api::{ApiExt, ProvideRuntimeApi};
|
||||
use pezsp_blockchain::{HeaderMetadata, TreeRoute};
|
||||
@@ -37,6 +36,7 @@ use pezsp_runtime::{
|
||||
transaction_validity::{TransactionSource, TransactionValidity},
|
||||
};
|
||||
use pezsp_transaction_pool::runtime_api::TaggedTransactionQueue;
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use std::{
|
||||
marker::PhantomData,
|
||||
pin::Pin,
|
||||
|
||||
@@ -190,11 +190,11 @@ where
|
||||
#[cfg(test)]
|
||||
mod enactment_state_tests {
|
||||
use super::{EnactmentAction, EnactmentState};
|
||||
use bizinikiwi_test_runtime_client::runtime::{Block, Hash};
|
||||
use pezsc_transaction_pool_api::ChainEvent;
|
||||
use pezsp_blockchain::{HashAndNumber, TreeRoute};
|
||||
use pezsp_runtime::traits::NumberFor;
|
||||
use std::sync::Arc;
|
||||
use bizinikiwi_test_runtime_client::runtime::{Block, Hash};
|
||||
|
||||
// some helpers for convenient blocks' hash naming
|
||||
fn a() -> HashAndNumber<Block> {
|
||||
|
||||
@@ -23,6 +23,10 @@ use crate::{
|
||||
ValidateTransactionPriority,
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use bizinikiwi_test_runtime::{
|
||||
bizinikiwi_test_pallet::pezpallet::Call as PalletCall, BalancesCall, Block, BlockNumber,
|
||||
Extrinsic, ExtrinsicBuilder, Hashing, RuntimeCall, Transfer, TransferData, H256,
|
||||
};
|
||||
use codec::Encode;
|
||||
use parking_lot::Mutex;
|
||||
use pezsc_transaction_pool_api::error;
|
||||
@@ -35,10 +39,6 @@ use pezsp_runtime::{
|
||||
},
|
||||
};
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
use bizinikiwi_test_runtime::{
|
||||
bizinikiwi_test_pallet::pezpallet::Call as PalletCall, BalancesCall, Block, BlockNumber, Extrinsic,
|
||||
ExtrinsicBuilder, Hashing, RuntimeCall, Transfer, TransferData, H256,
|
||||
};
|
||||
|
||||
type Pool<Api> = crate::graph::Pool<Api, ()>;
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ use futures::{
|
||||
FutureExt,
|
||||
};
|
||||
use parking_lot::Mutex;
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use pezsc_transaction_pool_api::{
|
||||
error::Error as TxPoolApiError, ChainEvent, ImportNotificationStream,
|
||||
MaintainedTransactionPool, PoolStatus, TransactionFor, TransactionPool, TransactionSource,
|
||||
@@ -69,6 +68,7 @@ use pezsp_runtime::{
|
||||
transaction_validity::{TransactionTag as Tag, TransactionValidityError, ValidTransaction},
|
||||
Saturating,
|
||||
};
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use std::{
|
||||
collections::{BTreeMap, HashMap, HashSet},
|
||||
pin::Pin,
|
||||
|
||||
@@ -25,14 +25,14 @@ use crate::{
|
||||
LOG_TARGET,
|
||||
};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use prometheus_endpoint::{
|
||||
exponential_buckets, histogram_opts, linear_buckets, register, Counter, Gauge, Histogram,
|
||||
PrometheusError, Registry, U64,
|
||||
};
|
||||
#[cfg(doc)]
|
||||
use pezsc_transaction_pool_api::TransactionPool;
|
||||
use pezsc_transaction_pool_api::TransactionStatus;
|
||||
use pezsc_utils::mpsc;
|
||||
use prometheus_endpoint::{
|
||||
exponential_buckets, histogram_opts, linear_buckets, register, Counter, Gauge, Histogram,
|
||||
PrometheusError, Registry, U64,
|
||||
};
|
||||
use std::{
|
||||
collections::{hash_map::Entry, HashMap},
|
||||
future::Future,
|
||||
|
||||
@@ -558,9 +558,9 @@ where
|
||||
///
|
||||
/// This method initializes an `ExternalWatcherContext` for the provided transaction hash, sets
|
||||
/// up the necessary communication channel with listener's task, and unfolds an external
|
||||
/// (meaning that it can be exposed to [`pezsc_transaction_pool_api::TransactionPool`] API client
|
||||
/// e.g. rpc) stream of transaction status events. If an external watcher is already present for
|
||||
/// the given transaction, it returns `None`.
|
||||
/// (meaning that it can be exposed to [`pezsc_transaction_pool_api::TransactionPool`] API
|
||||
/// client e.g. rpc) stream of transaction status events. If an external watcher is already
|
||||
/// present for the given transaction, it returns `None`.
|
||||
///
|
||||
/// The `submit_timestamp` indicates the time at which a transaction is submitted.
|
||||
/// It is primarily used to calculate event timings for metric collection.
|
||||
|
||||
@@ -203,9 +203,9 @@ mod tests {
|
||||
fork_aware_txpool::view::FinishRevalidationLocalChannels,
|
||||
TimedTransactionSource, ValidateTransactionPriority,
|
||||
};
|
||||
use futures::executor::block_on;
|
||||
use bizinikiwi_test_runtime::{AccountId, Transfer, H256};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::Alice;
|
||||
use futures::executor::block_on;
|
||||
#[test]
|
||||
fn revalidation_queue_works() {
|
||||
let api = Arc::new(TestApi::default());
|
||||
|
||||
@@ -970,9 +970,9 @@ where
|
||||
|
||||
#[cfg(test)]
|
||||
mod tx_mem_pool_tests {
|
||||
use futures::future::join_all;
|
||||
use bizinikiwi_test_runtime::{AccountId, Extrinsic, ExtrinsicBuilder, Transfer, H256};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use futures::future::join_all;
|
||||
|
||||
use crate::{
|
||||
common::tests::TestApi, fork_aware_txpool::view_store::ViewStoreSubmitOutcome,
|
||||
|
||||
@@ -24,7 +24,6 @@ use std::{cmp::Ordering, collections::HashSet, fmt, hash, sync::Arc, time::Insta
|
||||
|
||||
use crate::LOG_TARGET;
|
||||
use pezsc_transaction_pool_api::{error, InPoolTransaction, PoolStatus};
|
||||
use serde::Serialize;
|
||||
use pezsp_core::hexdisplay::HexDisplay;
|
||||
use pezsp_runtime::{
|
||||
traits::Member,
|
||||
@@ -33,6 +32,7 @@ use pezsp_runtime::{
|
||||
TransactionTag as Tag,
|
||||
},
|
||||
};
|
||||
use serde::Serialize;
|
||||
use tracing::{trace, warn};
|
||||
|
||||
use super::{
|
||||
|
||||
@@ -603,14 +603,14 @@ mod tests {
|
||||
use crate::common::tests::{pool, uxt, TestApi, INVALID_NONCE};
|
||||
use assert_matches::assert_matches;
|
||||
use base::TimedTransactionSource;
|
||||
use bizinikiwi_test_runtime::{AccountId, ExtrinsicBuilder, Transfer, H256};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::{Alice, Bob};
|
||||
use codec::Encode;
|
||||
use futures::executor::block_on;
|
||||
use parking_lot::Mutex;
|
||||
use pezsc_transaction_pool_api::TransactionStatus;
|
||||
use pezsp_runtime::transaction_validity::TransactionSource;
|
||||
use std::{collections::HashMap, time::Instant};
|
||||
use bizinikiwi_test_runtime::{AccountId, ExtrinsicBuilder, Transfer, H256};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::{Alice, Bob};
|
||||
|
||||
const SOURCE: TimedTransactionSource =
|
||||
TimedTransactionSource { source: TransactionSource::External, timestamp: None };
|
||||
|
||||
@@ -25,8 +25,8 @@ use std::{
|
||||
|
||||
use crate::LOG_TARGET;
|
||||
use pezsc_transaction_pool_api::error;
|
||||
use serde::Serialize;
|
||||
use pezsp_runtime::{traits::Member, transaction_validity::TransactionTag as Tag};
|
||||
use serde::Serialize;
|
||||
use tracing::trace;
|
||||
|
||||
use super::{
|
||||
|
||||
@@ -399,9 +399,9 @@ mod tests {
|
||||
graph::Pool,
|
||||
TimedTransactionSource,
|
||||
};
|
||||
use futures::executor::block_on;
|
||||
use bizinikiwi_test_runtime::{AccountId, Transfer, H256};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::{Alice, Bob};
|
||||
use futures::executor::block_on;
|
||||
|
||||
#[test]
|
||||
fn revalidation_queue_works() {
|
||||
|
||||
@@ -38,7 +38,6 @@ use crate::{
|
||||
use async_trait::async_trait;
|
||||
use futures::{channel::oneshot, future, prelude::*, Future, FutureExt};
|
||||
use parking_lot::Mutex;
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use pezsc_transaction_pool_api::{
|
||||
error::Error as TxPoolError, ChainEvent, ImportNotificationStream, MaintainedTransactionPool,
|
||||
PoolStatus, TransactionFor, TransactionPool, TransactionSource, TransactionStatusStreamFor,
|
||||
@@ -53,6 +52,7 @@ use pezsp_runtime::{
|
||||
},
|
||||
transaction_validity::{TransactionTag as Tag, TransactionValidityError},
|
||||
};
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
pin::Pin,
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
//! Tests for fork-aware transaction pool.
|
||||
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use fatp_common::{
|
||||
finalized_block_event, invalid_hash, new_best_block_event, pool, pool_with_api,
|
||||
test_chain_with_forks, LOG_TARGET, SOURCE,
|
||||
@@ -30,8 +32,6 @@ use pezsc_transaction_pool_api::{
|
||||
};
|
||||
use pezsp_runtime::transaction_validity::InvalidTransaction;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use tracing::debug;
|
||||
|
||||
pub mod fatp_common;
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
|
||||
//! Tests for fork-aware transaction pool.
|
||||
|
||||
use pezsc_transaction_pool::{ChainApi, PoolLimit};
|
||||
use pezsc_transaction_pool_api::ChainEvent;
|
||||
use pezsp_runtime::transaction_validity::TransactionSource;
|
||||
use std::sync::Arc;
|
||||
use bizinikiwi_test_runtime_client::{
|
||||
runtime::{Block, Hash, Header},
|
||||
Sr25519Keyring::*,
|
||||
};
|
||||
use bizinikiwi_test_runtime_transaction_pool::{uxt, TestApi};
|
||||
use pezsc_transaction_pool::{ChainApi, PoolLimit};
|
||||
use pezsc_transaction_pool_api::ChainEvent;
|
||||
use pezsp_runtime::transaction_validity::TransactionSource;
|
||||
use std::sync::Arc;
|
||||
pub const LOG_TARGET: &str = "txpool";
|
||||
|
||||
use pezsc_transaction_pool::ForkAwareTxPool;
|
||||
|
||||
@@ -22,14 +22,14 @@ pub mod fatp_common;
|
||||
|
||||
use std::cmp::min;
|
||||
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use fatp_common::{
|
||||
finalized_block_event, invalid_hash, new_best_block_event, TestPoolBuilder, LOG_TARGET, SOURCE,
|
||||
};
|
||||
use futures::{executor::block_on, FutureExt};
|
||||
use pezsc_transaction_pool::ChainApi;
|
||||
use pezsc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionStatus};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
|
||||
#[test]
|
||||
fn fatp_finality_timeout_works() {
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
pub mod fatp_common;
|
||||
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use fatp_common::{
|
||||
finalized_block_event, invalid_hash, new_best_block_event, pool, TestPoolBuilder, LOG_TARGET,
|
||||
SOURCE,
|
||||
@@ -31,8 +33,6 @@ use pezsc_transaction_pool_api::{
|
||||
MaintainedTransactionPool, TransactionPool, TransactionStatus,
|
||||
};
|
||||
use pezsp_runtime::transaction_validity::{InvalidTransaction, TransactionValidityError};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use tracing::debug;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
pub mod fatp_common;
|
||||
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use fatp_common::{
|
||||
finalized_block_event, invalid_hash, new_best_block_event, TestPoolBuilder, LOG_TARGET, SOURCE,
|
||||
};
|
||||
@@ -29,8 +31,6 @@ use pezsc_transaction_pool_api::{
|
||||
error::Error as TxPoolError, MaintainedTransactionPool, TransactionPool, TransactionStatus,
|
||||
};
|
||||
use std::thread::sleep;
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use tracing::debug;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
pub mod fatp_common;
|
||||
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use fatp_common::{invalid_hash, new_best_block_event, TestPoolBuilder, LOG_TARGET, SOURCE};
|
||||
use futures::{executor::block_on, FutureExt};
|
||||
use pezsc_transaction_pool::ChainApi;
|
||||
@@ -27,8 +29,6 @@ use pezsc_transaction_pool_api::{
|
||||
error::Error as TxPoolError, LocalTransactionPool, MaintainedTransactionPool, TransactionPool,
|
||||
TransactionStatus,
|
||||
};
|
||||
use bizinikiwi_test_runtime_client::Sr25519Keyring::*;
|
||||
use bizinikiwi_test_runtime_transaction_pool::uxt;
|
||||
use tracing::info;
|
||||
#[test]
|
||||
fn fatp_prio_ready_higher_evicts_lower() {
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
|
||||
//! Tests for top-level transaction pool api
|
||||
|
||||
use bizinikiwi_test_runtime_client::{
|
||||
runtime::{Block, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, TransferData},
|
||||
ClientBlockImportExt,
|
||||
Sr25519Keyring::*,
|
||||
};
|
||||
use bizinikiwi_test_runtime_transaction_pool::{uxt, TestApi};
|
||||
use codec::Encode;
|
||||
use futures::{
|
||||
executor::{block_on, block_on_stream},
|
||||
@@ -38,12 +44,6 @@ use pezsp_runtime::{
|
||||
transaction_validity::{TransactionSource, ValidTransaction},
|
||||
};
|
||||
use std::{collections::BTreeSet, pin::Pin, sync::Arc};
|
||||
use bizinikiwi_test_runtime_client::{
|
||||
runtime::{Block, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, TransferData},
|
||||
ClientBlockImportExt,
|
||||
Sr25519Keyring::*,
|
||||
};
|
||||
use bizinikiwi_test_runtime_transaction_pool::{uxt, TestApi};
|
||||
use tracing::{debug, trace};
|
||||
|
||||
type Pool<Api> = pezsc_transaction_pool::Pool<Api, ()>;
|
||||
|
||||
Reference in New Issue
Block a user