From f7d4b7f721f7a9aa3ad4c46d62a73e8d080f215e Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 8 Aug 2017 12:27:40 +0200 Subject: [PATCH] Add tests that the proofs verify --- client/commands/query/query_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/commands/query/query_test.go b/client/commands/query/query_test.go index ecf1e5cef2..2bce1642fd 100644 --- a/client/commands/query/query_test.go +++ b/client/commands/query/query_test.go @@ -73,6 +73,8 @@ func TestAppProofs(t *testing.T) { err = wire.ReadBinaryBytes(bs, &data) require.Nil(err, "%+v", err) assert.EqualValues(v, data.Value) + err = proofExists.Verify(k, bs, proofExists.RootHash) + assert.Nil(err, "%+v", err) // Test non-existing key. @@ -82,4 +84,8 @@ func TestAppProofs(t *testing.T) { require.Nil(bs) require.Nil(proofExists) require.NotNil(proofNotExists) + err = proofNotExists.Verify(missing, proofNotExists.RootHash) + assert.Nil(err, "%+v", err) + err = proofNotExists.Verify(k, proofNotExists.RootHash) + assert.NotNil(err) }