Skip to content
Snippets Groups Projects
Commit 9000e3b5 authored by Éloïs's avatar Éloïs
Browse files

apply new fmt version

parent 82cfe75d
No related branches found
No related tags found
1 merge request!59Resolve "Upgrade all dependencies"
...@@ -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]
......
...@@ -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 !")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment