Merge rust-bitcoin/rust-bitcoin#4233: test: add coverage for ServiceFlags::P2P_V2

c0e20dbf2e test: add coverage for ServiceFlags::P2P_V2 (Bruno Garcia)

Pull request description:

  Include `P2P_V2` on `service_flags_test`

ACKs for top commit:
  tcharding:
    ACK c0e20dbf2e
  apoelstra:
    ACK c0e20dbf2e1406a3f3df5538d1397b233078cd7c; successfully ran local tests

Tree-SHA512: 6ebb2f493bcc8fc6643cec67945a81692f03ceb976d75e10ce6052e775901846b9795f31817439b4484ef2d1eaae122d7da270cac2b59d7bb41cb2015593d1f5
This commit is contained in:
merge-script 2025-03-13 01:51:10 +00:00
commit bc8de7846e
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 7 additions and 2 deletions

View File

@ -405,6 +405,7 @@ mod tests {
ServiceFlags::WITNESS, ServiceFlags::WITNESS,
ServiceFlags::COMPACT_FILTERS, ServiceFlags::COMPACT_FILTERS,
ServiceFlags::NETWORK_LIMITED, ServiceFlags::NETWORK_LIMITED,
ServiceFlags::P2P_V2,
]; ];
let mut flags = ServiceFlags::NONE; let mut flags = ServiceFlags::NONE;
@ -430,8 +431,12 @@ mod tests {
// Test formatting. // Test formatting.
assert_eq!("ServiceFlags(NONE)", ServiceFlags::NONE.to_string()); assert_eq!("ServiceFlags(NONE)", ServiceFlags::NONE.to_string());
assert_eq!("ServiceFlags(WITNESS)", ServiceFlags::WITNESS.to_string()); assert_eq!("ServiceFlags(WITNESS)", ServiceFlags::WITNESS.to_string());
let flag = ServiceFlags::WITNESS | ServiceFlags::BLOOM | ServiceFlags::NETWORK; assert_eq!("ServiceFlags(P2P_V2)", ServiceFlags::P2P_V2.to_string());
assert_eq!("ServiceFlags(NETWORK|BLOOM|WITNESS)", flag.to_string()); let flag = ServiceFlags::WITNESS
| ServiceFlags::BLOOM
| ServiceFlags::NETWORK
| ServiceFlags::P2P_V2;
assert_eq!("ServiceFlags(NETWORK|BLOOM|WITNESS|P2P_V2)", flag.to_string());
let flag = ServiceFlags::WITNESS | 0xf0.into(); let flag = ServiceFlags::WITNESS | 0xf0.into();
assert_eq!("ServiceFlags(WITNESS|COMPACT_FILTERS|0xb0)", flag.to_string()); assert_eq!("ServiceFlags(WITNESS|COMPACT_FILTERS|0xb0)", flag.to_string());
} }