Add tests that the proofs verify

This commit is contained in:
Ethan Frey 2017-08-08 12:27:40 +02:00
parent cedb66066c
commit f7d4b7f721
1 changed files with 6 additions and 0 deletions

View File

@ -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)
}