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
0070028f
Commit
0070028f
authored
Aug 13, 2020
by
Cecile Tonglet
Browse files
WIP
Forked at:
e9164236
Parent branch: origin/rococo-branch
parent
5caaaeb9
Pipeline
#103764
canceled with stages
in 5 minutes and 35 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
node/test-service/src/lib.rs
View file @
0070028f
...
...
@@ -67,7 +67,7 @@ pub fn polkadot_test_new_full(
)
->
Result
<
(
TaskManager
,
Arc
<
FullClient
<
polkadot_test_runtime
::
RuntimeApi
,
PolkadotTestExecutor
>>
,
Arc
<
polkadot_service
::
FullClient
<
polkadot_test_runtime
::
RuntimeApi
,
PolkadotTestExecutor
>>
,
FullNodeHandles
,
Arc
<
NetworkService
<
Block
,
Hash
>>
,
Arc
<
RpcHandlers
>
,
...
...
@@ -88,17 +88,12 @@ pub fn polkadot_test_new_full(
Ok
((
task_manager
,
client
,
handles
,
network
,
rpc_handlers
))
}
// TODO: that comes from service, make it public?
type
FullClient
<
RuntimeApi
,
Executor
>
=
service
::
TFullClient
<
Block
,
RuntimeApi
,
Executor
>
;
/// A wrapper for the test client that implements YaExecuteWithClient.
pub
struct
TestClient
(
pub
Arc
<
FullClient
<
polkadot_test_runtime
::
RuntimeApi
,
PolkadotTestExecutor
>>
);
// TODO: that comes from service, make it public?
type
FullBackend
=
service
::
TFullBackend
<
Block
>
;
/// A wrapper for the test client that implements `YaExecuteWithClient`.
pub
struct
TestClient
(
pub
Arc
<
polkadot_service
::
FullClient
<
polkadot_test_runtime
::
RuntimeApi
,
PolkadotTestExecutor
>>
);
// TODO: maybe implementable for any Arc<TFullClient<...>>?
impl
YaExecuteWithClient
for
TestClient
{
fn
execute_with
<
T
:
ExecuteWithClient
>
(
&
self
,
t
:
T
)
->
T
::
Output
{
T
::
execute_with_client
::
<
_
,
_
,
FullBackend
>
(
t
,
self
.0
.clone
())
T
::
execute_with_client
::
<
_
,
_
,
polkadot_service
::
FullBackend
>
(
t
,
self
.0
.clone
())
}
}
...
...
service/src/lib.rs
View file @
0070028f
...
...
@@ -109,16 +109,16 @@ impl IdentifyVariant for Box<dyn ChainSpec> {
}
}
type
FullBackend
=
service
::
TFullBackend
<
Block
>
;
type
FullSelectChain
=
sc_consensus
::
LongestChain
<
FullBackend
,
Block
>
;
type
FullClient
<
RuntimeApi
,
Executor
>
=
service
::
TFullClient
<
Block
,
RuntimeApi
,
Executor
>
;
type
FullGrandpaBlockImport
<
RuntimeApi
,
Executor
>
=
grandpa
::
GrandpaBlockImport
<
pub
type
FullBackend
=
service
::
TFullBackend
<
Block
>
;
pub
type
FullSelectChain
=
sc_consensus
::
LongestChain
<
FullBackend
,
Block
>
;
pub
type
FullClient
<
RuntimeApi
,
Executor
>
=
service
::
TFullClient
<
Block
,
RuntimeApi
,
Executor
>
;
pub
type
FullGrandpaBlockImport
<
RuntimeApi
,
Executor
>
=
grandpa
::
GrandpaBlockImport
<
FullBackend
,
Block
,
FullClient
<
RuntimeApi
,
Executor
>
,
FullSelectChain
>
;
type
LightBackend
=
service
::
TLightBackendWithHash
<
Block
,
sp_runtime
::
traits
::
BlakeTwo256
>
;
pub
type
LightBackend
=
service
::
TLightBackendWithHash
<
Block
,
sp_runtime
::
traits
::
BlakeTwo256
>
;
type
LightClient
<
RuntimeApi
,
Executor
>
=
pub
type
LightClient
<
RuntimeApi
,
Executor
>
=
service
::
TLightClientWithBackend
<
Block
,
RuntimeApi
,
Executor
,
LightBackend
>
;
#[cfg(feature
=
"full-node"
)]
...
...
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