Skip to content

Commit

Permalink
ashwin's fix for failing pgx unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
i-norden committed Nov 12, 2021
1 parent 4fb92b5 commit 5f4968b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions statediff/indexer/database/sql/postgres/pgx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"strings"
"testing"

"github.com/jackc/pgx/pgtype"
"github.com/jackc/pgx/v4/pgxpool"

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

var data pgtype.Text
err = dbPool.QueryRow(ctx, `SELECT data FROM example WHERE id = 1`).Scan(&data)
var data string
err = dbPool.QueryRow(ctx, `SELECT cast(data AS TEXT) FROM example WHERE id = 1`).Scan(&data)
if err != nil {
t.Fatal(err)
}

test_helpers.ExpectEqual(t, data, bi.String())
actual := new(big.Int)
actual.SetString(data.String, 10)
actual.SetString(data, 10)
test_helpers.ExpectEqual(t, actual, bi)
})

Expand Down

0 comments on commit 5f4968b

Please sign in to comment.