Skip to content

Commit

Permalink
update table list test
Browse files Browse the repository at this point in the history
  • Loading branch information
bysomeone committed Jan 13, 2022
1 parent 23637f2 commit 370b58f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions common/db/table/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ func TestTableListPrimary(t *testing.T) {
assert.Nil(t, err)
//save to database
util.SaveKVList(ldb, kvs)
// get smaller key
hash := tx1.Hash()
if bytes.Compare(hash, tx2.Hash()) > 0 {
hash = tx2.Hash()
Expand Down Expand Up @@ -507,13 +508,6 @@ func TestTableListPrimary(t *testing.T) {
assert.Equal(t, 1, len(rows))
assert.Equal(t, tx1.Hash(), rows[0].Primary)

// List with primary
rows, _ = table.ListIndex("From", nil, hash, 10, db.ListASC)
assert.Equal(t, 1, len(rows))
assert.NotEqual(t, hash, rows[0].Primary)
_, err = table.ListIndex("From", nil, hash, 10, db.ListDESC)
assert.Equal(t, types.ErrNotFound, err)

// List with primary and prefix
_, err = table.ListIndex("From", []byte(addr1)[:20], tx1.Hash(), 10, db.ListASC)
assert.Equal(t, types.ErrNotFound, err)
Expand Down

0 comments on commit 370b58f

Please sign in to comment.