Browse Source

substrate upgrade: fix warnings about unused result values in tests

Mokhtar Naamani 6 years ago
parent
commit
5ce1912b6e
2 changed files with 13 additions and 13 deletions
  1. 3 3
      src/governance/election.rs
  2. 10 10
      src/governance/proposals.rs

+ 3 - 3
src/governance/election.rs

@@ -1955,7 +1955,7 @@ mod tests {
 
             let n = 1 + Election::announcing_period();
             System::set_block_number(n);
-            Election::on_finalise(n);
+            let _ = Election::on_finalise(n);
 
             for i in 1..20 {
                 assert!(Election::vote(
@@ -1982,7 +1982,7 @@ mod tests {
 
             let n = n + Election::voting_period();
             System::set_block_number(n);
-            Election::on_finalise(n);
+            let _ = Election::on_finalise(n);
 
             for i in 1..20 {
                 assert!(Election::reveal(
@@ -2012,7 +2012,7 @@ mod tests {
 
             let n = n + Election::revealing_period();
             System::set_block_number(n);
-            Election::on_finalise(n);
+            let _ = Election::on_finalise(n);
 
             assert_eq!(
                 Council::active_council().len(),

+ 10 - 10
src/governance/proposals.rs

@@ -558,7 +558,7 @@ mod tests {
     // or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
     use runtime_primitives::{
         testing::{Digest, DigestItem, Header, UintAuthorityId},
-        traits::{BlakeTwo256, IdentityLookup, OnFinalize},
+        traits::{BlakeTwo256, IdentityLookup},
         BuildStorage,
     };
     use srml_support::*;
@@ -1110,7 +1110,7 @@ mod tests {
             assert_eq!(Proposals::votes_by_proposal(1), expected_votes);
 
             System::set_block_number(2);
-            Proposals::on_finalise(2);
+            let _ = Proposals::on_finalise(2);
 
             assert!(Proposals::active_proposal_ids().is_empty());
             assert_eq!(Proposals::proposals(1).status, Approved);
@@ -1152,7 +1152,7 @@ mod tests {
             assert_runtime_code_empty!();
 
             System::set_block_number(2);
-            Proposals::on_finalise(2);
+            let _ = Proposals::on_finalise(2);
 
             // Check that runtime code has been updated after proposal approved.
             assert_runtime_code!(wasm_code());
@@ -1208,7 +1208,7 @@ mod tests {
             assert_runtime_code_empty!();
 
             System::set_block_number(2);
-            Proposals::on_finalise(2);
+            let _ = Proposals::on_finalise(2);
 
             // Check that runtime code has been updated after proposal approved.
             assert_runtime_code!(wasm_code());
@@ -1263,14 +1263,14 @@ mod tests {
 
             let expiration_block = System::block_number() + Proposals::voting_period();
             System::set_block_number(2);
-            Proposals::on_finalise(2);
+            let _ = Proposals::on_finalise(2);
 
             // Check that runtime code has NOT been updated yet,
             // because not all councilors voted and voting period is not expired yet.
             assert_runtime_code_empty!();
 
             System::set_block_number(expiration_block);
-            Proposals::on_finalise(expiration_block);
+            let _ = Proposals::on_finalise(expiration_block);
 
             // Check that runtime code has been updated after proposal approved.
             assert_runtime_code!(wasm_code());
@@ -1326,7 +1326,7 @@ mod tests {
             assert_runtime_code_empty!();
 
             System::set_block_number(2);
-            Proposals::on_finalise(2);
+            let _ = Proposals::on_finalise(2);
 
             // Check that runtime code has NOT been updated after proposal slashed.
             assert_runtime_code_empty!();
@@ -1383,7 +1383,7 @@ mod tests {
             assert_runtime_code_empty!();
 
             System::set_block_number(2);
-            Proposals::on_finalise(2);
+            let _ = Proposals::on_finalise(2);
 
             // Check that runtime code has NOT been updated after proposal rejected.
             assert_runtime_code_empty!();
@@ -1440,7 +1440,7 @@ mod tests {
             assert_runtime_code_empty!();
 
             System::set_block_number(2);
-            Proposals::on_finalise(2);
+            let _ = Proposals::on_finalise(2);
 
             // Check that runtime code has NOT been updated after proposal slashed.
             assert_runtime_code_empty!();
@@ -1507,7 +1507,7 @@ mod tests {
 
             let expiration_block = System::block_number() + Proposals::voting_period();
             System::set_block_number(expiration_block);
-            Proposals::on_finalise(expiration_block);
+            let _ = Proposals::on_finalise(expiration_block);
 
             // Check that runtime code has NOT been updated after proposal slashed.
             assert_runtime_code_empty!();