Skip to content

Commit 759903f

Browse files
bysomeonevipwzw
authored andcommitted
update table list test
1 parent 12df230 commit 759903f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

common/db/table/table_test.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ func TestTableListPrimary(t *testing.T) {
470470
assert.Nil(t, err)
471471
//save to database
472472
util.SaveKVList(ldb, kvs)
473+
// get smaller key
473474
hash := tx1.Hash()
474475
if bytes.Compare(hash, tx2.Hash()) > 0 {
475476
hash = tx2.Hash()
@@ -507,13 +508,6 @@ func TestTableListPrimary(t *testing.T) {
507508
assert.Equal(t, 1, len(rows))
508509
assert.Equal(t, tx1.Hash(), rows[0].Primary)
509510

510-
// List with primary
511-
rows, _ = table.ListIndex("From", nil, hash, 10, db.ListASC)
512-
assert.Equal(t, 1, len(rows))
513-
assert.NotEqual(t, hash, rows[0].Primary)
514-
_, err = table.ListIndex("From", nil, hash, 10, db.ListDESC)
515-
assert.Equal(t, types.ErrNotFound, err)
516-
517511
// List with primary and prefix
518512
_, err = table.ListIndex("From", []byte(addr1)[:20], tx1.Hash(), 10, db.ListASC)
519513
assert.Equal(t, types.ErrNotFound, err)

0 commit comments

Comments
 (0)