Skip to content

Commit 70c2658

Browse files
author
Joshua Mir
committed
cargo fix pass
1 parent e2ae160 commit 70c2658

File tree

5 files changed

+26
-27
lines changed

5 files changed

+26
-27
lines changed

datdot-node/node/src/chain_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn testnet_genesis(
136136
)>,
137137
root_key: AccountId,
138138
endowed_accounts: Option<Vec<AccountId>>,
139-
enable_println: bool,
139+
_enable_println: bool,
140140
) -> GenesisConfig {
141141
let endowed_accounts: Vec<AccountId> = endowed_accounts.unwrap_or_else(|| {
142142
vec![

datdot-node/node/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
22
33
use std::sync::Arc;
4-
use std::time::Duration;
4+
55
use sc_client_api::ExecutorProvider;
66
use sc_consensus::LongestChain;
77
use datdot_runtime::{self, primitives::Block, RuntimeApi};

datdot-node/pallets/datdot/src/lib.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ use sp_std::convert::{
4141
use frame_system::{
4242
self as system,
4343
ensure_signed,
44-
ensure_root,
45-
offchain
44+
ensure_root
4645
};
4746
use codec::{Encode, Decode};
4847
use sp_core::{
@@ -240,16 +239,16 @@ impl HashPayload for RootHashPayload {
240239
fn hash(&self) -> H256 {
241240
self.using_encoded(|dirtybits|{
242241
native::info!("Root Hash Dirty Payload [{:#?}]: {:x?}", dirtybits.len(), dirtybits);
243-
let mut dirtycopy = dirtybits.to_vec();
242+
let dirtycopy = dirtybits.to_vec();
244243
let mut x = 2;
245244
let mut bits : Vec<u8> = Vec::new();
246245
bits.push(*dirtycopy.get(0).expect(""));
247246
loop{
248247
let pt1 = dirtycopy.get(x+0..x+32).expect("");
249-
let mut pt2: &mut [u8; 8] = &mut [0,0,0,0,0,0,0,0];
248+
let pt2: &mut [u8; 8] = &mut [0,0,0,0,0,0,0,0];
250249
pt2.copy_from_slice(dirtycopy.get(x+32..x+40).expect(""));
251250
pt2.reverse();
252-
let mut pt3: &mut [u8;8] = &mut [0,0,0,0,0,0,0,0];
251+
let pt3: &mut [u8;8] = &mut [0,0,0,0,0,0,0,0];
253252
pt3.copy_from_slice(dirtycopy.get(x+40..x+48).expect(""));
254253
pt3.reverse();
255254
let mut newbits = [
@@ -273,10 +272,10 @@ impl HashPayload for ParentHashPayload {
273272
fn hash(&self) -> H256 {
274273
self.using_encoded(|b|{
275274
native::info!("Parent Hash Payload Dirty [{:x?}]: {:x?}", b.len(), b);
276-
let mut dirtycopy = b.to_vec();
275+
let dirtycopy = b.to_vec();
277276
let mut cleanbits: Vec<u8> = Vec::new();
278-
let mut hash_type = dirtycopy.get(0..1).expect("");
279-
let mut total_length = &mut [0,0,0,0,0,0,0,0];
277+
let hash_type = dirtycopy.get(0..1).expect("");
278+
let total_length = &mut [0,0,0,0,0,0,0,0];
280279
total_length.copy_from_slice(dirtycopy.get(1..9).expect(""));
281280
total_length.reverse();
282281

@@ -292,10 +291,10 @@ impl HashPayload for ChunkHashPayload {
292291
fn hash(&self) -> H256 {
293292
self.using_encoded(|b|{
294293
native::info!("Chunk Hash Payload: {:x?}", b);
295-
let mut dirtycopy = b.to_vec();
294+
let dirtycopy = b.to_vec();
296295
let mut cleanbits: Vec<u8> = Vec::new();
297-
let mut hash_type = dirtycopy.get(0..1).expect("");
298-
let mut total_length = &mut [0,0,0,0,0,0,0,0];
296+
let hash_type = dirtycopy.get(0..1).expect("");
297+
let total_length = &mut [0,0,0,0,0,0,0,0];
299298
total_length.copy_from_slice(dirtycopy.get(1..9).expect(""));
300299
total_length.reverse();
301300

@@ -437,13 +436,13 @@ decl_module!{
437436
//gutted temporarily to demonstrate datdot flow.
438437
//we should manually verify proof from raw bits.
439438
#[weight = (10000, Operational)] //todo weight
440-
fn submit_proof(origin, challenge_index: u64, proof: Vec<u8>) {
439+
fn submit_proof(origin, challenge_index: u64, _proof: Vec<u8>) {
441440
let account = ensure_signed(origin)?;
442441
// TODO - verify proof!
443442

444443

445444
native::info!("submitProof; challengeIndex: {:#?}", challenge_index);
446-
let mut challenge_attestors = Self::get_attestors_for(challenge_index);
445+
let challenge_attestors = Self::get_attestors_for(challenge_index);
447446
native::info!("submitProof; challengeAttestors: {:#?}", challenge_attestors);
448447
<ChallengeAttestors>::insert(&challenge_index, &challenge_attestors);
449448
Self::deposit_event(RawEvent::AttestPhase(challenge_index, challenge_attestors));
@@ -574,7 +573,7 @@ decl_module!{
574573
fn submit_attestation(origin, challenge_index: u64, attestation: Attestation) {
575574
let attestor = ensure_signed(origin)?;
576575
let mut challenge : ChallengeAttestations = <ChallengeAttestors>::get(challenge_index);
577-
let mut attestor_index;
576+
let attestor_index;
578577
for (user_index, user_account) in <Attestors<T>>::iter(){
579578
if user_account == attestor {
580579
attestor_index = user_index;
@@ -608,7 +607,7 @@ decl_module!{
608607
match user_indexes.binary_search(&user_index){
609608
Ok(i) => {
610609
user_indexes.remove(i);
611-
<ActiveAttestors>::mutate(|mut att_vec|{
610+
<ActiveAttestors>::mutate(|att_vec|{
612611
match att_vec.binary_search(&user_index){
613612
Ok(e) => {
614613
att_vec.remove(e);
@@ -658,7 +657,7 @@ decl_module!{
658657
<DatHosters<T>>::insert(&dat_pubkey, &dat_hosters);
659658
<UsersStorage<T>>::insert(&account, &current_user_dats);
660659
let user_index;
661-
if(current_user_dats.len() == 1){
660+
if current_user_dats.len() == 1 {
662661
let user_index_option = <UsersCount>::get().pop();
663662
let current_user_index = match user_index_option {
664663
Some(x) => {
@@ -724,7 +723,7 @@ decl_module!{
724723

725724

726725
#[weight = (10000, Operational)] //todo weight
727-
fn submit_challenge(origin, selected_user: u64, dat_id: u64){
726+
fn submit_challenge(_origin, selected_user: u64, dat_id: u64){
728727
let challenge_index = <ChallengeIndex>::get();
729728
let nonce = Self::unique_nonce();
730729
let new_random = (T::Randomness::random(b"dat_verify_init"), nonce)
@@ -796,7 +795,7 @@ decl_module!{
796795
native::info!("OnFinalize; Dat: {:#?}", dat);
797796
let deadline = challenge.2;
798797
let attesting = Self::is_attestation_complete(challenge_index);
799-
if (n >= deadline) {
798+
if n >= deadline {
800799
match attesting {
801800
Some(true) => {
802801
<SelectedChallenges<T>>::remove(challenge_index);
@@ -905,7 +904,7 @@ impl<T: Trait> Module<T> {
905904
}
906905

907906

908-
fn reward_seeder(rewarded: T::AccountId) {
907+
fn reward_seeder(_rewarded: T::AccountId) {
909908
//todo
910909
}
911910

datdot-node/runtime/src/impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ impl<T: Get<Perquintill>> Convert<Fixed128, Fixed128> for TargetedFeeAdjustment<
117117
mod tests {
118118
use super::*;
119119
use sp_runtime::assert_eq_error_rate;
120-
use crate::{MaximumBlockWeight, AvailableBlockRatio, Runtime};
121-
use crate::{constants::currency::*, TargetBlockFullness};
120+
use crate::{MaximumBlockWeight, Runtime};
121+
use crate::{TargetBlockFullness};
122122
use frame_support::weights::Weight;
123123
use core::num::NonZeroI128;
124124

datdot-node/runtime/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use sp_runtime::{
3333
impl_opaque_keys, generic, create_runtime_str, ModuleId,
3434
OpaqueExtrinsic, MultiSignature
3535
};
36-
use sp_runtime::curve::PiecewiseLinear;
36+
3737
use sp_runtime::transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority};
3838
use sp_runtime::traits::{
3939
self, BlakeTwo256, Block as BlockT, StaticLookup, SaturatedConversion,
@@ -58,7 +58,7 @@ use codec::Encode;
5858

5959
/// Implementations of some helper traits passed into runtime modules as associated types.
6060
pub mod impls;
61-
use impls::{CurrencyToVoteHandler, Author, LinearWeightToFee, TargetedFeeAdjustment};
61+
use impls::{CurrencyToVoteHandler, Author};
6262

6363
/// Constant values used within the runtime.
6464
pub mod constants;
@@ -235,7 +235,7 @@ impl pallet_authorship::Trait for Runtime {
235235
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
236236
type UncleGenerations = UncleGenerations;
237237
type FilterUncle = ();
238-
type EventHandler = (ImOnline);
238+
type EventHandler = ImOnline;
239239
}
240240

241241
impl_opaque_keys! {
@@ -407,7 +407,7 @@ impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for R
407407
// The `System::block_number` is initialized with `n+1`,
408408
// so the actual block number is `n`.
409409
.saturating_sub(1);
410-
let tip = 0;
410+
let _tip = 0;
411411
let extra: SignedExtra = (
412412
frame_system::CheckVersion::<Runtime>::new(),
413413
frame_system::CheckGenesis::<Runtime>::new(),

0 commit comments

Comments
 (0)