Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
3be9444a
Unverified
Commit
3be9444a
authored
May 26, 2020
by
Cecile Tonglet
Committed by
GitHub
May 26, 2020
Browse files
Add HeaderBackend trait to BuildParachainContext for cumulus validation (#1153)
parent
6e1a3d00
Pipeline
#94175
failed with stages
in 11 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
collator/src/lib.rs
View file @
3be9444a
...
...
@@ -53,6 +53,7 @@ use std::pin::Pin;
use
futures
::{
future
,
Future
,
Stream
,
FutureExt
,
TryFutureExt
,
StreamExt
,
task
::
Spawn
};
use
log
::
warn
;
use
sc_client_api
::{
StateBackend
,
BlockchainEvents
};
use
sp_blockchain
::
HeaderBackend
;
use
sp_core
::
Pair
;
use
polkadot_primitives
::{
BlockId
,
Hash
,
Block
,
...
...
@@ -128,7 +129,7 @@ pub trait BuildParachainContext {
network
:
impl
Network
+
Clone
+
'static
,
)
->
Result
<
Self
::
ParachainContext
,
()
>
where
Client
:
ProvideRuntimeApi
<
Block
>
+
Send
+
Sync
+
BlockchainEvents
<
Block
>
+
'static
,
Client
:
ProvideRuntimeApi
<
Block
>
+
HeaderBackend
<
Block
>
+
BlockchainEvents
<
Block
>
+
Send
+
Sync
+
'static
,
Client
::
Api
:
RuntimeApiCollection
<
Extrinsic
>
,
<
Client
::
Api
as
ApiExt
<
Block
>>
::
StateBackend
:
StateBackend
<
HashFor
<
Block
>>
,
Extrinsic
:
codec
::
Codec
+
Send
+
Sync
+
'static
,
...
...
service/src/client.rs
View file @
3be9444a
...
...
@@ -16,16 +16,17 @@
//! Polkadot Client meta trait
use
sc_client_api
::
BlockchainEvents
;
use
sp_api
::{
ProvideRuntimeApi
,
ConstructRuntimeApi
,
CallApiAt
};
use
sp_blockchain
::
HeaderBackend
;
use
sp_runtime
::
traits
::
Block
as
BlockT
;
use
sc_client_api
::
Backend
as
BackendT
;
use
sc_client_api
::
{
Backend
as
BackendT
,
BlockchainEvents
}
;
/// Polkadot client abstraction, this super trait only pulls in functionality required for
/// polkadot internal crates like polkadot-collator.
pub
trait
PolkadotClient
<
Block
,
Backend
,
Runtime
>
:
BlockchainEvents
<
Block
>
+
Sized
+
Send
+
Sync
+
ProvideRuntimeApi
<
Block
,
Api
=
Runtime
::
RuntimeApi
>
+
HeaderBackend
<
Block
>
+
CallApiAt
<
Block
,
Error
=
sp_blockchain
::
Error
,
...
...
@@ -42,7 +43,7 @@ impl<Block, Backend, Runtime, Client> PolkadotClient<Block, Backend, Runtime> fo
Block
:
BlockT
,
Runtime
:
ConstructRuntimeApi
<
Block
,
Self
>
,
Backend
:
BackendT
<
Block
>
,
Client
:
BlockchainEvents
<
Block
>
+
ProvideRuntimeApi
<
Block
,
Api
=
Runtime
::
RuntimeApi
>
Client
:
BlockchainEvents
<
Block
>
+
ProvideRuntimeApi
<
Block
,
Api
=
Runtime
::
RuntimeApi
>
+
HeaderBackend
<
Block
>
+
Sized
+
Send
+
Sync
+
CallApiAt
<
Block
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment