Skip to content

Commit 5f4968b

Browse files
committed
ashwin's fix for failing pgx unit test
1 parent 4fb92b5 commit 5f4968b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

statediff/indexer/database/sql/postgres/pgx_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"strings"
2424
"testing"
2525

26-
"github.com/jackc/pgx/pgtype"
2726
"github.com/jackc/pgx/v4/pgxpool"
2827

2928
"github.com/ethereum/go-ethereum/statediff/indexer/database/sql/postgres"
@@ -86,15 +85,15 @@ func TestPostgresPGX(t *testing.T) {
8685
t.Fatal(err)
8786
}
8887

89-
var data pgtype.Text
90-
err = dbPool.QueryRow(ctx, `SELECT data FROM example WHERE id = 1`).Scan(&data)
88+
var data string
89+
err = dbPool.QueryRow(ctx, `SELECT cast(data AS TEXT) FROM example WHERE id = 1`).Scan(&data)
9190
if err != nil {
9291
t.Fatal(err)
9392
}
9493

9594
test_helpers.ExpectEqual(t, data, bi.String())
9695
actual := new(big.Int)
97-
actual.SetString(data.String, 10)
96+
actual.SetString(data, 10)
9897
test_helpers.ExpectEqual(t, actual, bi)
9998
})
10099

0 commit comments

Comments
 (0)