Run cargo fmt

This commit is contained in:
aniampio
2021-10-20 17:05:00 +01:00
parent 9110a8eefd
commit 0eaad032f6
18 changed files with 434 additions and 234 deletions
+17 -11
View File
@@ -15,8 +15,10 @@ use crate::network_monitor::monitor::summary_producer::SummaryProducer;
use crate::network_monitor::monitor::Monitor;
use crate::network_monitor::tested_network::TestedNetwork;
use crate::storage::NodeStatusStorage;
use coconut_interface::{Credential, hash_to_scalar, Parameters};
use credentials::bandwidth::{prepare_for_spending, BandwidthVoucherAttributes, BANDWIDTH_VALUE, TOTAL_ATTRIBUTES};
use coconut_interface::{hash_to_scalar, Credential, Parameters};
use credentials::bandwidth::{
prepare_for_spending, BandwidthVoucherAttributes, BANDWIDTH_VALUE, TOTAL_ATTRIBUTES,
};
use credentials::obtain_aggregate_verification_key;
use crypto::asymmetric::{encryption, identity};
use futures::channel::mpsc;
@@ -176,17 +178,21 @@ async fn TEMPORARY_obtain_bandwidth_credential(
.expect("could not obtain aggregate verification key of ALL validators");
let params = Parameters::new(TOTAL_ATTRIBUTES).unwrap();
let bandwidth_credential_attributes = BandwidthVoucherAttributes{
serial_number : params.random_scalar(),
binding_number : params.random_scalar(),
voucher_value : hash_to_scalar(BANDWIDTH_VALUE.to_be_bytes()),
voucher_info : hash_to_scalar(String::from("BandwidthVoucher").as_bytes()),
let bandwidth_credential_attributes = BandwidthVoucherAttributes {
serial_number: params.random_scalar(),
binding_number: params.random_scalar(),
voucher_value: hash_to_scalar(BANDWIDTH_VALUE.to_be_bytes()),
voucher_info: hash_to_scalar(String::from("BandwidthVoucher").as_bytes()),
};
let bandwidth_credential =
credentials::bandwidth::obtain_signature(&params, &bandwidth_credential_attributes, &validators, &verification_key)
.await
.expect("failed to obtain bandwidth credential!");
let bandwidth_credential = credentials::bandwidth::obtain_signature(
&params,
&bandwidth_credential_attributes,
&validators,
&verification_key,
)
.await
.expect("failed to obtain bandwidth credential!");
prepare_for_spending(
&identity.to_bytes(),