From 9032163c5a080a15167cbe3a0d5ae632173ba8d1 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 11 Aug 2020 20:47:50 +0300 Subject: [PATCH] turn probability eyeballing into an actual test --- chain/messagepool/block_proba_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chain/messagepool/block_proba_test.go b/chain/messagepool/block_proba_test.go index 2cc2ecc2a..b39ea587e 100644 --- a/chain/messagepool/block_proba_test.go +++ b/chain/messagepool/block_proba_test.go @@ -4,5 +4,12 @@ import "testing" func TestBlockProbability(t *testing.T) { mp := &MessagePool{} - t.Logf("%+v\n", mp.blockProbabilities(1-0.15)) + bp := mp.blockProbabilities(1 - 0.15) + t.Logf("%+v\n", bp) + for i := 0; i < len(bp)-1; i++ { + if bp[i] < bp[i+1] { + t.Fatalf("expected decreasing block probabilities for this quality: %d %f %f", + i, bp[i], bp[i+1]) + } + } }