Browse Source

node: Fix tests.

Shamil Gadelshin 4 years ago
parent
commit
1b6df8daf6
2 changed files with 28 additions and 3 deletions
  1. 25 3
      node/src/chain_spec/mod.rs
  2. 3 0
      runtime/src/runtime_api.rs

+ 25 - 3
node/src/chain_spec/mod.rs

@@ -395,7 +395,7 @@ pub fn testnet_genesis(
 #[cfg(test)]
 pub(crate) mod tests {
     use super::*;
-    use crate::service::{new_full, new_light};
+    use crate::service::{new_full_base, new_light_base, NewFullBase};
     use sc_service_test;
 
     fn local_testnet_genesis_instant_single() -> GenesisConfig {
@@ -471,8 +471,30 @@ pub(crate) mod tests {
     fn test_connectivity() {
         sc_service_test::connectivity(
             integration_test_config_with_two_authorities(),
-            |config| new_full(config),
-            |config| new_light(config),
+            |config| {
+                let NewFullBase {
+                    task_manager,
+                    client,
+                    network,
+                    transaction_pool,
+                    ..
+                } = new_full_base(config, |_, _| ())?;
+                Ok(sc_service_test::TestNetComponents::new(
+                    task_manager,
+                    client,
+                    network,
+                    transaction_pool,
+                ))
+            },
+            |config| {
+                let (keep_alive, _, client, network, transaction_pool) = new_light_base(config)?;
+                Ok(sc_service_test::TestNetComponents::new(
+                    keep_alive,
+                    client,
+                    network,
+                    transaction_pool,
+                ))
+            },
         );
     }
 }

+ 3 - 0
runtime/src/runtime_api.rs

@@ -32,6 +32,9 @@ pub type SignedExtra = (
     pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
 );
 
+/// We don't use specific Address types (like Indices).
+pub type Address = AccountId;
+
 /// Digest item type.
 pub type DigestItem = generic::DigestItem<Hash>;