[dependencies]: remove util/macros (#11501)
* [dependencies]: remove `util/macros` * fix typo: `flish` -> flush` * [json tests]: add log if `write` or `flush` fails `write` is performed to `stdout` `logging` is performed to `stderr` * [rocksdb-migration]: remove unused `Progress` * [rpc test]: BTreeMap -> `btreemap!`
This commit is contained in:
@@ -49,7 +49,6 @@ use light::net::{
|
||||
Capabilities, Handler as LightHandler, EventContext, SampleStore,
|
||||
};
|
||||
use log::{trace, warn};
|
||||
use macros::hash_map;
|
||||
use network::{
|
||||
client_version::ClientVersion,
|
||||
NetworkProtocolHandler, NetworkContext, PeerId, ProtocolId,
|
||||
@@ -795,7 +794,11 @@ impl NetworkConfiguration {
|
||||
max_peers: self.max_peers,
|
||||
min_peers: self.min_peers,
|
||||
max_handshakes: self.max_pending_peers,
|
||||
reserved_protocols: hash_map![WARP_SYNC_PROTOCOL_ID => self.snapshot_peers],
|
||||
reserved_protocols: {
|
||||
let mut reserved = HashMap::new();
|
||||
reserved.insert(WARP_SYNC_PROTOCOL_ID, self.snapshot_peers);
|
||||
reserved
|
||||
},
|
||||
reserved_nodes: self.reserved_nodes,
|
||||
ip_filter: self.ip_filter,
|
||||
non_reserved_mode: if self.allow_non_reserved { NonReservedPeerMode::Accept } else { NonReservedPeerMode::Deny },
|
||||
|
||||
@@ -93,7 +93,6 @@ impl TransactionsStats {
|
||||
mod tests {
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use super::{Stats, TransactionsStats, NodeId, H256};
|
||||
use macros::hash_map;
|
||||
|
||||
#[test]
|
||||
fn should_keep_track_of_propagations() {
|
||||
@@ -112,10 +111,12 @@ mod tests {
|
||||
let stats = stats.get(&hash);
|
||||
assert_eq!(stats, Some(&Stats {
|
||||
first_seen: 5,
|
||||
propagated_to: hash_map![
|
||||
enodeid1 => 2,
|
||||
enodeid2 => 1
|
||||
],
|
||||
propagated_to: {
|
||||
let mut map = HashMap::new();
|
||||
map.insert(enodeid1, 2);
|
||||
map.insert(enodeid2, 1);
|
||||
map
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user