update types

This commit is contained in:
Ethan Buchman
2018-02-03 03:23:10 -05:00
parent 061ad355bb
commit 4e3488c677
10 changed files with 71 additions and 61 deletions

View File

@@ -47,20 +47,20 @@ func (a ABCIResults) Bytes() []byte {
// Hash returns a merkle hash of all results
func (a ABCIResults) Hash() []byte {
return merkle.SimpleHashFromHashables(a.toHashables())
return merkle.SimpleHashFromHashers(a.toHashers())
}
// ProveResult returns a merkle proof of one result from the set
func (a ABCIResults) ProveResult(i int) merkle.SimpleProof {
_, proofs := merkle.SimpleProofsFromHashables(a.toHashables())
_, proofs := merkle.SimpleProofsFromHashers(a.toHashers())
return *proofs[i]
}
func (a ABCIResults) toHashables() []merkle.Hashable {
func (a ABCIResults) toHashers() []merkle.Hasher {
l := len(a)
hashables := make([]merkle.Hashable, l)
hashers := make([]merkle.Hasher, l)
for i := 0; i < l; i++ {
hashables[i] = a[i]
hashers[i] = a[i]
}
return hashables
return hashers
}