enable PIBD_HIST capability by default (#3500)

This commit is contained in:
Antioch Peverell 2020-11-26 09:53:00 +00:00 committed by GitHub
parent 96afc766a1
commit 14f4683ca1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -401,9 +401,7 @@ impl Default for Capabilities {
| Capabilities::TXHASHSET_HIST | Capabilities::TXHASHSET_HIST
| Capabilities::PEER_LIST | Capabilities::PEER_LIST
| Capabilities::TX_KERNEL_HASH | Capabilities::TX_KERNEL_HASH
| Capabilities::PIBD_HIST
// To be enabled once we start supporting the various PIBD segment msgs.
// | Capabilities::PIBD_HIST
} }
} }

View file

@ -41,6 +41,7 @@ fn default_capabilities() {
assert!(x.contains(Capabilities::TXHASHSET_HIST)); assert!(x.contains(Capabilities::TXHASHSET_HIST));
assert!(x.contains(Capabilities::PEER_LIST)); assert!(x.contains(Capabilities::PEER_LIST));
assert!(x.contains(Capabilities::TX_KERNEL_HASH)); assert!(x.contains(Capabilities::TX_KERNEL_HASH));
assert!(x.contains(Capabilities::PIBD_HIST));
assert_eq!( assert_eq!(
x, x,
@ -48,5 +49,6 @@ fn default_capabilities() {
| Capabilities::TXHASHSET_HIST | Capabilities::TXHASHSET_HIST
| Capabilities::PEER_LIST | Capabilities::PEER_LIST
| Capabilities::TX_KERNEL_HASH | Capabilities::TX_KERNEL_HASH
| Capabilities::PIBD_HIST
); );
} }

View file

@ -55,19 +55,19 @@ fn test_capabilities() {
assert_eq!( assert_eq!(
expected, expected,
p2p::types::Capabilities::from_bits_truncate(0b1111 as u32), p2p::types::Capabilities::from_bits_truncate(0b11111 as u32),
); );
assert_eq!( assert_eq!(
expected, expected,
p2p::types::Capabilities::from_bits_truncate(0b00001111 as u32), p2p::types::Capabilities::from_bits_truncate(0b00011111 as u32),
); );
assert_eq!( assert_eq!(
expected, expected,
p2p::types::Capabilities::from_bits_truncate(0b00101111 as u32), p2p::types::Capabilities::from_bits_truncate(0b01011111 as u32),
); );
assert!(p2p::types::Capabilities::from_bits_truncate(0b00101111 as u32).contains(expected)); assert!(p2p::types::Capabilities::from_bits_truncate(0b01011111 as u32).contains(expected));
assert!( assert!(
p2p::types::Capabilities::from_bits_truncate(0b00101111 as u32) p2p::types::Capabilities::from_bits_truncate(0b00101111 as u32)