Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Commits
9000e3b5
Commit
9000e3b5
authored
7 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
apply new fmt version
parent
82cfe75d
No related branches found
No related tags found
1 merge request
!59
Resolve "Upgrade all dependencies"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
blockchain/sync.rs
+5
-4
5 additions, 4 deletions
blockchain/sync.rs
dal/block.rs
+11
-8
11 additions, 8 deletions
dal/block.rs
with
16 additions
and
12 deletions
blockchain/sync.rs
+
5
−
4
View file @
9000e3b5
...
@@ -130,10 +130,11 @@ pub fn sync_ts(
...
@@ -130,10 +130,11 @@ pub fn sync_ts(
.bind
(
&
[
sqlite
::
Value
::
Integer
(
0
)])
.bind
(
&
[
sqlite
::
Value
::
Integer
(
0
)])
.expect
(
"Fail to get ts current block !"
);
.expect
(
"Fail to get ts current block !"
);
let
current_ts_blockstamp
=
if
let
Some
(
row
)
=
cursor
.next
()
.expect
(
"cursor error"
)
{
let
current_ts_blockstamp
=
if
let
Some
(
row
)
=
cursor
.next
()
.expect
(
"cursor error"
)
{
let
block_id
=
BlockId
(
row
[
1
]
let
block_id
=
BlockId
(
row
[
1
]
.as_integer
()
.as_integer
()
.expect
(
"Fail to parse current ts blockstamp !"
)
.expect
(
"Fail to parse current ts blockstamp !"
)
as
u32
,
as
u32
);
);
let
block_hash
=
BlockHash
(
let
block_hash
=
BlockHash
(
Hash
::
from_hex
(
Hash
::
from_hex
(
row
[
0
]
row
[
0
]
...
...
This diff is collapsed.
Click to expand it.
dal/block.rs
+
11
−
8
View file @
9000e3b5
...
@@ -44,10 +44,11 @@ pub fn blockstamp_to_timestamp(blockstamp: &Blockstamp, db: &DuniterDB) -> Optio
...
@@ -44,10 +44,11 @@ pub fn blockstamp_to_timestamp(blockstamp: &Blockstamp, db: &DuniterDB) -> Optio
.next
()
.next
()
.expect
(
"convert blockstamp to timestamp failure at step 2 !"
)
.expect
(
"convert blockstamp to timestamp failure at step 2 !"
)
{
{
return
Some
(
row
[
0
]
return
Some
(
row
[
0
]
.as_integer
()
.as_integer
()
.expect
(
"convert blockstamp to timestamp failure at step 3 !"
)
.expect
(
"convert blockstamp to timestamp failure at step 3 !"
)
as
u64
,
as
u64
);
);
}
}
None
None
}
}
...
@@ -298,10 +299,12 @@ impl DALBlock {
...
@@ -298,10 +299,12 @@ impl DALBlock {
},
},
block
:
BlockDocument
{
block
:
BlockDocument
{
nonce
,
nonce
,
number
:
BlockId
(
row
[
3
]
number
:
BlockId
(
row
[
3
]
.as_integer
()
.as_integer
()
.expect
(
"dal::get_block() : fail to parse number !"
)
.expect
(
"dal::get_block() : fail to parse number !"
)
as
u32
),
as
u32
,
),
pow_min
:
row
[
4
]
pow_min
:
row
[
4
]
.as_integer
()
.as_integer
()
.expect
(
"dal::get_block() : fail to parse pow min !"
)
.expect
(
"dal::get_block() : fail to parse pow min !"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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