Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
substrate
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Denis_P
substrate
Commits
99335419
Commit
99335419
authored
5 years ago
by
Marcio Diaz
Browse files
Options
Downloads
Patches
Plain Diff
Use get_light_header in in_mem.
parent
89a20f1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/client/src/in_mem.rs
+13
-2
13 additions, 2 deletions
core/client/src/in_mem.rs
with
13 additions
and
2 deletions
core/client/src/in_mem.rs
+
13
−
2
View file @
99335419
...
@@ -32,7 +32,9 @@ use crate::error;
...
@@ -32,7 +32,9 @@ use crate::error;
use
crate
::
backend
::{
self
,
NewBlockState
,
StorageCollection
,
ChildStorageCollection
};
use
crate
::
backend
::{
self
,
NewBlockState
,
StorageCollection
,
ChildStorageCollection
};
use
crate
::
light
;
use
crate
::
light
;
use
crate
::
leaves
::
LeafSet
;
use
crate
::
leaves
::
LeafSet
;
use
crate
::
blockchain
::{
self
,
BlockStatus
,
HeaderBackend
,
well_known_cache_keys
::
Id
as
CacheKeyId
};
use
crate
::
blockchain
::{
self
,
BlockStatus
,
HeaderBackend
,
LightHeader
,
well_known_cache_keys
::
Id
as
CacheKeyId
};
struct
PendingBlock
<
B
:
BlockT
>
{
struct
PendingBlock
<
B
:
BlockT
>
{
block
:
StoredBlock
<
B
>
,
block
:
StoredBlock
<
B
>
,
...
@@ -222,7 +224,8 @@ impl<Block: BlockT> Blockchain<Block> {
...
@@ -222,7 +224,8 @@ impl<Block: BlockT> Blockchain<Block> {
None
None
}
else
{
}
else
{
let
route
=
crate
::
blockchain
::
tree_route
(
let
route
=
crate
::
blockchain
::
tree_route
(
|
id
|
self
.header
(
id
)
?
.ok_or_else
(||
error
::
Error
::
UnknownBlock
(
format!
(
"{:?}"
,
id
))),
|
id
|
self
.get_light_header
(
id
)
?
.ok_or_else
(||
error
::
Error
::
UnknownBlock
(
format!
(
"{:?}"
,
id
))),
BlockId
::
Hash
(
best_hash
),
BlockId
::
Hash
(
best_hash
),
BlockId
::
Hash
(
*
header
.parent_hash
()),
BlockId
::
Hash
(
*
header
.parent_hash
()),
)
?
;
)
?
;
...
@@ -293,6 +296,14 @@ impl<Block: BlockT> HeaderBackend<Block> for Blockchain<Block> {
...
@@ -293,6 +296,14 @@ impl<Block: BlockT> HeaderBackend<Block> for Blockchain<Block> {
}))
}))
}
}
fn
set_light_header
(
&
self
,
_data
:
LightHeader
<
Block
>
)
{
unimplemented!
()
}
fn
get_light_header
(
&
self
,
_id
:
BlockId
<
Block
>
)
->
error
::
Result
<
Option
<
LightHeader
<
Block
>>>
{
unimplemented!
()
}
fn
info
(
&
self
)
->
blockchain
::
Info
<
Block
>
{
fn
info
(
&
self
)
->
blockchain
::
Info
<
Block
>
{
let
storage
=
self
.storage
.read
();
let
storage
=
self
.storage
.read
();
blockchain
::
Info
{
blockchain
::
Info
{
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment