Skip to content

Commit

Permalink
Adding tests for balloon changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Mar 14, 2019
1 parent 3d29308 commit eb603af
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions balloon/balloon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func TestQueryMembership(t *testing.T) {
{[]byte{0x5a}, uint64(0)},
}

// Asking for a future/wrong membership should not fail
_, err = balloon.QueryMembership([]byte{0x10}, 15)
require.NoError(t, err)

for i, c := range testCases {
_, mutations, err := balloon.Add(c.key)
require.NoErrorf(t, err, "Error adding event %d", i)
Expand Down Expand Up @@ -165,6 +169,9 @@ func TestQueryConsistencyProof(t *testing.T) {
balloon, err := NewBalloon(store, hashing.NewFakeXorHasher)
require.NoError(t, err)

_, err = balloon.QueryConsistency(uint64(30), uint64(600))
require.Error(t, err, "Asking for a future/wrong consitency should fail")

for j := 0; j <= int(c.end); j++ {
_, mutations, err := balloon.Add(util.Uint64AsBytes(uint64(j)))
require.NoErrorf(t, err, "Error adding event %d", j)
Expand Down

0 comments on commit eb603af

Please sign in to comment.