From 594e6a4ab98ff4cdb5fced9f9612c510266d2d6f Mon Sep 17 00:00:00 2001 From: Raghav Gulati Date: Wed, 8 May 2019 09:00:25 -0700 Subject: [PATCH] Add a note why we're expecting two messages As the adversary has turned of signature verification, we should expect to see two messages (the correctly signed and the incorrectly signed one) when we publish. Those that have verification on, should only see one. --- floodsub_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/floodsub_test.go b/floodsub_test.go index 8ba03d3..ca8d923 100644 --- a/floodsub_test.go +++ b/floodsub_test.go @@ -1022,6 +1022,9 @@ func TestImproperlySignedMessageRejected(t *testing.T) { <-time.After(1 * time.Second) adversaryCancel() + // Ensure the adversary successfully publishes the incorrectly signed + // message. If the adversary "sees" this, we successfully got through + // their local validation. if len(adversaryMessages) != 2 { t.Fatalf("got %d messages, expected 2", len(adversaryMessages)) }