General Merkle Proof (#2298)

* first commit

finalize rebase

add protoc_merkle to Makefile

* in progress

* fix kvstore

* fix tests

* remove iavl dependency

* fix tx_test

* fix test_abci_cli

fix test_apps

* fix test_apps

* fix test_cover

* rm rebase residue

* address comment in progress

* finalize rebase
This commit is contained in:
Joon
2018-09-29 09:03:19 +09:00
committed by Ethan Buchman
parent fc073746a0
commit 71a34adfe5
38 changed files with 1867 additions and 749 deletions

View File

@ -69,8 +69,8 @@ func TestValidTxProof(t *testing.T) {
leaf := txs[i]
leafHash := leaf.Hash()
proof := txs.Proof(i)
assert.Equal(t, i, proof.Index, "%d: %d", h, i)
assert.Equal(t, len(txs), proof.Total, "%d: %d", h, i)
assert.Equal(t, i, proof.Proof.Index, "%d: %d", h, i)
assert.Equal(t, len(txs), proof.Proof.Total, "%d: %d", h, i)
assert.EqualValues(t, root, proof.RootHash, "%d: %d", h, i)
assert.EqualValues(t, leaf, proof.Data, "%d: %d", h, i)
assert.EqualValues(t, leafHash, proof.LeafHash(), "%d: %d", h, i)
@ -128,7 +128,7 @@ func assertBadProof(t *testing.T, root []byte, bad []byte, good TxProof) {
// This can happen if we have a slightly different total (where the
// path ends up the same). If it is something else, we have a real
// problem.
assert.NotEqual(t, proof.Total, good.Total, "bad: %#v\ngood: %#v", proof, good)
assert.NotEqual(t, proof.Proof.Total, good.Proof.Total, "bad: %#v\ngood: %#v", proof, good)
}
}
}