mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 12:51:02 +00:00
Make basic collation working
This commit is contained in:
@@ -66,12 +66,12 @@ pub struct HeadUpdate {
|
||||
|
||||
/// Helper for the Polkadot client. This is expected to be a lightweight handle
|
||||
/// like an `Arc`.
|
||||
pub trait PolkadotClient: Clone {
|
||||
pub trait PolkadotClient: Clone + 'static {
|
||||
/// The error type for interacting with the Polkadot client.
|
||||
type Error: std::fmt::Debug + Send;
|
||||
|
||||
/// A stream that yields finalized head-data for a certain parachain.
|
||||
type Finalized: Stream<Item = Vec<u8>> + Send;
|
||||
type Finalized: Stream<Item = Vec<u8>> + Send + Unpin;
|
||||
|
||||
/// Get a stream of finalized heads.
|
||||
fn finalized_heads(&self, para_id: ParaId) -> ClientResult<Self::Finalized>;
|
||||
@@ -85,11 +85,11 @@ pub trait PolkadotClient: Clone {
|
||||
}
|
||||
|
||||
/// Spawns a future that follows the Polkadot relay chain for the given parachain.
|
||||
pub fn follow_polkadot<'a, L: 'a, P: 'a>(para_id: ParaId, local: Arc<L>, polkadot: P)
|
||||
-> ClientResult<impl Future<Output = ()> + Send + 'a>
|
||||
pub fn follow_polkadot<L, P>(para_id: ParaId, local: Arc<L>, polkadot: P)
|
||||
-> ClientResult<impl Future<Output = ()> + Send + Unpin>
|
||||
where
|
||||
L: LocalClient + Send + Sync,
|
||||
P: PolkadotClient + Send + Sync,
|
||||
P: PolkadotClient,
|
||||
{
|
||||
let finalized_heads = polkadot.finalized_heads(para_id)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user