Ensure any call to disable peer has a reason (#321)

* Fix warnings in libp2p

* Force a reason when you use the fatalist disable_peer

* Print more information

* Slightly more concise ref-fu

* Tracing for figuring out what's going into genesis

* Merge

* Fxi test
This commit is contained in:
Gav Wood
2018-07-15 23:30:53 +02:00
committed by GitHub
parent 1e1ddf61f2
commit 0e40983f3b
3 changed files with 10 additions and 11 deletions
+2 -3
View File
@@ -216,7 +216,6 @@ impl<T: Trait> runtime_primitives::BuildStorage for GenesisConfig<T>
{
fn build_storage(mut self) -> ::std::result::Result<runtime_io::TestExternalities, String> {
use std::collections::HashMap;
use runtime_io::twox_128;
use codec::Encode;
self.parachains.sort_unstable_by_key(|&(ref id, _)| id.clone());
@@ -225,11 +224,11 @@ impl<T: Trait> runtime_primitives::BuildStorage for GenesisConfig<T>
let only_ids: Vec<_> = self.parachains.iter().map(|&(ref id, _)| id).cloned().collect();
let mut map: HashMap<_, _> = map![
twox_128(<Parachains<T>>::key()).to_vec() => only_ids.encode()
Self::hash(<Parachains<T>>::key()).to_vec() => only_ids.encode()
];
for (id, code) in self.parachains {
let key = twox_128(&<Code<T>>::key_for(&id)).to_vec();
let key = Self::hash(&<Code<T>>::key_for(&id)).to_vec();
map.insert(key, code.encode());
}