Skip to content

Commit

Permalink
Fix minor errors in x/sync tests (#2709)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored Feb 7, 2024
1 parent 813bd48 commit c523cee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions x/sync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func Test_Sync_FindNextKey_ExtraValues(t *testing.T) {
// next key at prefix of newly added point
nextKey, err := syncer.findNextKey(context.Background(), lastKey, maybe.Nothing[[]byte](), proof.EndProof)
require.NoError(err)
require.NotNil(nextKey)
require.True(nextKey.HasValue())

require.True(isPrefix(midPointVal, nextKey.Value()))

Expand All @@ -455,7 +455,7 @@ func Test_Sync_FindNextKey_ExtraValues(t *testing.T) {
// next key at prefix of newly added point
nextKey, err = syncer.findNextKey(context.Background(), lastKey, maybe.Nothing[[]byte](), proof.EndProof)
require.NoError(err)
require.NotNil(nextKey)
require.True(nextKey.HasValue())

// deal with odd length key
require.True(isPrefix(midPointVal, nextKey.Value()))
Expand Down Expand Up @@ -572,7 +572,8 @@ func Test_Sync_FindNextKey_DifferentChild(t *testing.T) {

nextKey, err := syncer.findNextKey(context.Background(), proof.KeyValues[len(proof.KeyValues)-1].Key, maybe.Nothing[[]byte](), proof.EndProof)
require.NoError(err)
require.Equal(nextKey.Value(), lastKey)
require.True(nextKey.HasValue())
require.Equal(lastKey, nextKey.Value())
}

// Test findNextKey by computing the expected result in a naive, inefficient
Expand Down

0 comments on commit c523cee

Please sign in to comment.