Skip to content

Commit

Permalink
Fix failing cursor test
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya1702 committed Apr 16, 2024
1 parent e4b34e5 commit 35da2a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/soroban-rpc/internal/events/cursor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestParseCursor(t *testing.T) {
for _, cursor := range []Cursor{
for _, cursor := range []*Cursor{
{
Ledger: math.MaxInt32,
Tx: 1048575,
Expand All @@ -29,7 +29,7 @@ func TestParseCursor(t *testing.T) {
Event: 1,
},
} {
parsed, err := ParseCursor(cursor.String())
parsed, err := cursor.ParseCursor(cursor.String())
assert.NoError(t, err)
assert.Equal(t, cursor, parsed)
}
Expand Down Expand Up @@ -97,12 +97,12 @@ func TestCursorCmp(t *testing.T) {
b := testCase.b
expected := testCase.expected

if got := a.Cmp(b); got != expected {
if got := a.Cmp(&b); got != expected {
t.Fatalf("expected (%v).Cmp(%v) to be %v but got %v", a, b, expected, got)
}
a, b = b, a
expected *= -1
if got := a.Cmp(b); got != expected {
if got := a.Cmp(&b); got != expected {
t.Fatalf("expected (%v).Cmp(%v) to be %v but got %v", a, b, expected, got)
}
}
Expand Down

0 comments on commit 35da2a5

Please sign in to comment.