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
ca22bdca
Unverified
Commit
ca22bdca
authored
May 26, 2021
by
Bastian Köcher
Committed by
GitHub
May 26, 2021
Browse files
Add `UsageProvider` trait to `AbstractClient` (#3106)
* Add `UsageProvider` trait to `AbstractClient` * Fix
parent
45176894
Pipeline
#139401
passed with stages
in 29 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
node/service/src/client.rs
View file @
ca22bdca
...
...
@@ -23,7 +23,7 @@ use sp_blockchain::HeaderBackend;
use
sp_runtime
::{
Justifications
,
generic
::{
BlockId
,
SignedBlock
},
traits
::{
Block
as
BlockT
,
BlakeTwo256
},
};
use
sc_client_api
::{
Backend
as
BackendT
,
BlockchainEvents
,
KeyIterator
,
AuxStore
};
use
sc_client_api
::{
Backend
as
BackendT
,
BlockchainEvents
,
KeyIterator
,
AuxStore
,
UsageProvider
};
use
sp_storage
::{
StorageData
,
StorageKey
,
ChildInfo
,
PrefixedStorageKey
};
use
polkadot_primitives
::
v1
::{
Block
,
ParachainHost
,
AccountId
,
Nonce
,
Balance
,
Header
,
BlockNumber
,
Hash
};
use
consensus_common
::
BlockStatus
;
...
...
@@ -79,6 +79,7 @@ pub trait AbstractClient<Block, Backend>:
StateBackend
=
Backend
::
State
>
+
AuxStore
+
UsageProvider
<
Block
>
where
Block
:
BlockT
,
Backend
:
BackendT
<
Block
>
,
...
...
@@ -95,6 +96,7 @@ impl<Block, Backend, Client> AbstractClient<Block, Backend> for Client
+
ProvideRuntimeApi
<
Block
>
+
HeaderBackend
<
Block
>
+
AuxStore
+
UsageProvider
<
Block
>
+
Sized
+
Send
+
Sync
...
...
@@ -173,7 +175,7 @@ impl ClientHandle for Client {
}
}
impl
sc_client_api
::
UsageProvider
<
Block
>
for
Client
{
impl
UsageProvider
<
Block
>
for
Client
{
fn
usage_info
(
&
self
)
->
sc_client_api
::
ClientInfo
<
Block
>
{
match
self
{
Self
::
Polkadot
(
client
)
=>
client
.usage_info
(),
...
...
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