Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable PIBD_HIST capability by default #3500

Merged
merged 1 commit into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions p2p/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,7 @@ impl Default for Capabilities {
| Capabilities::TXHASHSET_HIST
| Capabilities::PEER_LIST
| Capabilities::TX_KERNEL_HASH

// To be enabled once we start supporting the various PIBD segment msgs.
// | Capabilities::PIBD_HIST
| Capabilities::PIBD_HIST
}
}

Expand Down
2 changes: 2 additions & 0 deletions p2p/tests/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ fn default_capabilities() {
assert!(x.contains(Capabilities::TXHASHSET_HIST));
assert!(x.contains(Capabilities::PEER_LIST));
assert!(x.contains(Capabilities::TX_KERNEL_HASH));
assert!(x.contains(Capabilities::PIBD_HIST));

assert_eq!(
x,
Capabilities::HEADER_HIST
| Capabilities::TXHASHSET_HIST
| Capabilities::PEER_LIST
| Capabilities::TX_KERNEL_HASH
| Capabilities::PIBD_HIST
);
}
8 changes: 4 additions & 4 deletions p2p/tests/ser_deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ fn test_capabilities() {

assert_eq!(
expected,
p2p::types::Capabilities::from_bits_truncate(0b1111 as u32),
p2p::types::Capabilities::from_bits_truncate(0b11111 as u32),
);
assert_eq!(
expected,
p2p::types::Capabilities::from_bits_truncate(0b00001111 as u32),
p2p::types::Capabilities::from_bits_truncate(0b00011111 as u32),
);

assert_eq!(
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!(
p2p::types::Capabilities::from_bits_truncate(0b00101111 as u32)
Expand Down