Skip to content

Commit

Permalink
feat: add missing messages for conformance 009
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko von Leipzig committed May 17, 2021
1 parent dcfe7a4 commit b77769c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -59,7 +59,7 @@ Quick overview of the current status, providing implementation progress and test
| [![conf_006](https://img.shields.io/badge/006-██████████-green) ](SPEC.md#ZG-CONFORMANCE-006)| :warning: Need to confirm expected behaviour with zcash.
| [![conf_007](https://img.shields.io/badge/007-██████████-red) ](SPEC.md#ZG-CONFORMANCE-007)| :warning: Need to confirm expected behaviour with zcash.
| [![conf_008](https://img.shields.io/badge/008-████░░░░░░-red) ](SPEC.md#ZG-CONFORMANCE-008)| :warning: Need to confirm expected behaviour with zcash.
| [![conf_009](https://img.shields.io/badge/009-██████░░░░-green) ](SPEC.md#ZG-CONFORMANCE-009)|
| [![conf_009](https://img.shields.io/badge/009-██████████-green) ](SPEC.md#ZG-CONFORMANCE-009)|
| [![conf_010](https://img.shields.io/badge/010-██████████-red) ](SPEC.md#ZG-CONFORMANCE-010)|
| [![conf_011](https://img.shields.io/badge/011-░░░░░░░░░░-inactive)](SPEC.md#ZG-CONFORMANCE-011)|
| [![conf_012](https://img.shields.io/badge/012-██████████-red) ](SPEC.md#ZG-CONFORMANCE-012)| :warning: Zcashd node config requires investigation.
Expand Down
15 changes: 6 additions & 9 deletions src/tests/conformance/messages.rs
Expand Up @@ -158,17 +158,16 @@ async fn ignores_unsolicited_responses() {
.await
.unwrap();

// TODO: rest of the message types
let test_messages = vec![
Message::Pong(Nonce::default()),
Message::Headers(Headers::empty()),
Message::Addr(Addr::empty()),
// Block(Block),
// NotFound(Inv),
// Tx(Tx),
Message::Block(Box::new(Block::testnet_genesis())),
Message::NotFound(Inv::new(vec![Block::testnet_1().txs[0].inv_hash()])),
Message::Tx(Block::testnet_2().txs[0].clone()),
];

let filter = MessageFilter::with_all_auto_reply().enable_logging();
let filter = MessageFilter::with_all_auto_reply();

for message in test_messages {
message.write_to_stream(&mut stream).await.unwrap();
Expand All @@ -179,10 +178,8 @@ async fn ignores_unsolicited_responses() {
.await
.unwrap();

match filter.read_from_stream(&mut stream).await.unwrap() {
Message::Pong(returned_nonce) => assert_eq!(nonce, returned_nonce),
msg => panic!("Expected pong: {:?}", msg),
}
let pong = filter.read_from_stream(&mut stream).await.unwrap();
assert_matches!(pong, Message::Pong(..));
}

node.stop().await;
Expand Down

0 comments on commit b77769c

Please sign in to comment.