Commit 2c6e8f2c authored by Éloïs's avatar Éloïs

[style] apply last fmt version

parent 52fdff33
......@@ -461,7 +461,8 @@ impl BlockchainModule {
wot_index,
wot,
&self.forks_states,
) {
)
{
current_blockstamp = block.blockstamp();
// Update forks states
self.forks_states = duniter_dal::block::get_forks(
......
......@@ -539,7 +539,8 @@ pub fn sync_ts<DC: DuniterConf>(
&wot_db,
&expire_certs,
None,
) {
)
{
all_apply_valid_block_duration += SystemTime::now()
.duration_since(apply_valid_block_begin)
.unwrap();
......
......@@ -190,10 +190,8 @@ impl DuniterModule<DuRsConf, DursMsg> for SkeletonModule {
) = mpsc::channel();
// Create proxy channel
let (proxy_sender, proxy_receiver): (
mpsc::Sender<DursMsg>,
mpsc::Receiver<DursMsg>,
) = mpsc::channel();
let (proxy_sender, proxy_receiver): (mpsc::Sender<DursMsg>, mpsc::Receiver<DursMsg>) =
mpsc::channel();
// Launch a proxy thread that transform DursMsgContent() to SkeleonMsg::DursMsgContent(DursMsgContent())
let router_sender_clone = router_sender.clone();
......
......@@ -430,10 +430,8 @@ impl DuniterModule<DuRsConf, DursMsg> for TuiModule {
mpsc::channel();
// Create proxy channel
let (proxy_sender, proxy_receiver): (
mpsc::Sender<DursMsg>,
mpsc::Receiver<DursMsg>,
) = mpsc::channel();
let (proxy_sender, proxy_receiver): (mpsc::Sender<DursMsg>, mpsc::Receiver<DursMsg>) =
mpsc::channel();
// Launch a proxy thread that transform DursMsgContent() to TuiMess::DursMsgContent(DursMsgContent())
let tui_sender_clone = tui_sender.clone();
......
......@@ -318,10 +318,8 @@ impl DuniterModule<DuRsConf, DursMsg> for WS2PModule {
let ws2p_sender_clone = ws2p_module.main_thread_channel.0.clone();
// Create proxy channel
let (proxy_sender, proxy_receiver): (
mpsc::Sender<DursMsg>,
mpsc::Receiver<DursMsg>,
) = mpsc::channel();
let (proxy_sender, proxy_receiver): (mpsc::Sender<DursMsg>, mpsc::Receiver<DursMsg>) =
mpsc::channel();
let proxy_sender_clone = proxy_sender.clone();
// Launch a proxy thread that transform DursMsg to WS2PThreadSignal(DursMsg)
......@@ -492,20 +490,17 @@ impl DuniterModule<DuRsConf, DursMsg> for WS2PModule {
ws2p_module.my_head.clone().unwrap(),
);
trace!("Send my HEAD: {:#?}", my_json_head);
let _results: Result<
(),
ws::Error,
> = ws2p_module
let _results: Result<(), ws::Error> = ws2p_module
.websockets
.iter_mut()
.map(|ws| {
(ws.1).0.send(Message::text(
json!({
"name": "HEAD",
"body": {
"heads": [my_json_head]
}
})
"name": "HEAD",
"body": {
"heads": [my_json_head]
}
})
.to_string(),
))
})
......@@ -1157,15 +1152,15 @@ mod tests {
assert_eq!(
network_request_to_json(&request),
json!({
"reqId": format!("{:x}", 58),
"body": {
"name": "BLOCKS_CHUNK",
"params": {
"count": 50,
"fromNumber": 0
"reqId": format!("{:x}", 58),
"body": {
"name": "BLOCKS_CHUNK",
"params": {
"count": 50,
"fromNumber": 0
}
}
}
})
})
);
assert_eq!(
network_request_to_json(&request).to_string(),
......
......@@ -14,9 +14,9 @@ pub fn network_request_to_json(request: &OldNetworkRequest) -> serde_json::Value
req_full_id.1,
"BLOCKS_CHUNK",
json!({
"count": count,
"fromNumber": from_mumber
}),
"count": count,
"fromNumber": from_mumber
}),
),
OldNetworkRequest::GetRequirementsPending(ref req_full_id, _receiver, min_cert) => (
req_full_id.1,
......@@ -35,10 +35,10 @@ pub fn network_request_to_json(request: &OldNetworkRequest) -> serde_json::Value
};
json!({
"reqId": request_id,
"body" : {
"name": request_type,
"params": request_params
}
})
"reqId": request_id,
"body" : {
"name": request_type,
"params": request_params
}
})
}
......@@ -392,7 +392,7 @@ impl DALBlock {
median_index = self.block.issuers_count - 1;
}
self.median_frame = current_frame_vec[median_index];
// Calculate second tiercile index
let mut second_tiercile_index = match self.block.issuers_count % 3 {
1 | 2 => (self.block.issuers_count as f64 * (2.0 / 3.0)) as usize + 1,
......
......@@ -110,13 +110,11 @@ pub fn revert_tx(dbs: &CurrencyV10DBs, dal_tx: &DALTxV10) -> Result<(), DALError
.tx_doc
.get_outputs()[(s_index.1).0]
.clone();
let mut sources_destroyed_for_same_address: Vec<(
UTXOIndexV10,
SourceAmount,
)> = sources_destroyed_completed
.get(&tx_output.conditions.conditions)
.cloned()
.unwrap_or_default();
let mut sources_destroyed_for_same_address: Vec<(UTXOIndexV10, SourceAmount)> =
sources_destroyed_completed
.get(&tx_output.conditions.conditions)
.cloned()
.unwrap_or_default();
sources_destroyed_for_same_address
.push((*s_index, SourceAmount(tx_output.amount, tx_output.base)));
sources_destroyed_completed.insert(
......
......@@ -197,11 +197,11 @@ pub trait TextDocument: Document<PublicKey = PubKey, CurrencyType = str> {
/*/// Return document as text with leading signatures.
fn as_text_with_signatures(&self) -> String {
let mut text = self.as_text().to_string();
for sig in self.signatures() {
text = format!("{}{}\n", text, sig.to_base64());
}
text
}*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment