Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump indexer version to 3.0.0 #111

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions conduit/plugins/exporters/postgresql/postgresql_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"github.com/sirupsen/logrus"

sdk "github.com/algorand/go-algorand-sdk/v2/types"
"github.com/algorand/indexer/idb"
_ "github.com/algorand/indexer/idb/postgres" // register driver
"github.com/algorand/indexer/types"
iutil "github.com/algorand/indexer/util"
"github.com/algorand/indexer/v3/idb"
_ "github.com/algorand/indexer/v3/idb/postgres" // register driver
"github.com/algorand/indexer/v3/types"
iutil "github.com/algorand/indexer/v3/util"

"github.com/algorand/conduit/conduit/data"
"github.com/algorand/conduit/conduit/plugins"
Expand Down Expand Up @@ -77,8 +77,8 @@
}
db, ready, err := idb.IndexerDbByName(dbName, eCfg.ConnectionString, opts, logger)
if err != nil {
return nil, nil, fmt.Errorf("connect failure constructing db, %s: %v", dbName, err)
}

Check warning on line 81 in conduit/plugins/exporters/postgresql/postgresql_exporter.go

View check run for this annotation

Codecov / codecov/patch

conduit/plugins/exporters/postgresql/postgresql_exporter.go#L80-L81

Added lines #L80 - L81 were not covered by tests

return db, ready, nil
}
Expand All @@ -86,26 +86,26 @@
// RoundRequest connects to the database, queries the round, and closes the
// connection. If there is a problem with the configuration, an error will be
// returned in the Init phase and this function will return 0.
func (exp *postgresqlExporter) RoundRequest(cfg plugins.PluginConfig) (uint64, error) {
nullLogger := logrus.New()
nullLogger.Out = io.Discard // no logging

db, _, err := createIndexerDB(nullLogger, true, cfg)
if err != nil {
// Assume the error is related to an uninitialized DB.
// If it is something more serious, the failure will be detected during Init.
return 0, nil
}

Check warning on line 98 in conduit/plugins/exporters/postgresql/postgresql_exporter.go

View check run for this annotation

Codecov / codecov/patch

conduit/plugins/exporters/postgresql/postgresql_exporter.go#L89-L98

Added lines #L89 - L98 were not covered by tests

rnd, err := db.GetNextRoundToAccount()
// ignore non initialized error because that would happen during Init.
// This case probably wont be hit except in very unusual cases because
// in most cases `createIndexerDB` would fail first.
if err != nil && err != idb.ErrorNotInitialized {
return 0, fmt.Errorf("postgres.RoundRequest(): failed to get next round: %w", err)
}

Check warning on line 106 in conduit/plugins/exporters/postgresql/postgresql_exporter.go

View check run for this annotation

Codecov / codecov/patch

conduit/plugins/exporters/postgresql/postgresql_exporter.go#L100-L106

Added lines #L100 - L106 were not covered by tests

return rnd, nil

Check warning on line 108 in conduit/plugins/exporters/postgresql/postgresql_exporter.go

View check run for this annotation

Codecov / codecov/patch

conduit/plugins/exporters/postgresql/postgresql_exporter.go#L108

Added line #L108 was not covered by tests
}

func (exp *postgresqlExporter) Init(ctx context.Context, initProvider data.InitProvider, cfg plugins.PluginConfig, logger *logrus.Logger) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"gopkg.in/yaml.v3"

sdk "github.com/algorand/go-algorand-sdk/v2/types"
_ "github.com/algorand/indexer/idb/dummy"
_ "github.com/algorand/indexer/v3/idb/dummy"

"github.com/algorand/conduit/conduit"
"github.com/algorand/conduit/conduit/data"
Expand Down
2 changes: 1 addition & 1 deletion conduit/plugins/exporters/postgresql/util/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/sirupsen/logrus"

"github.com/algorand/indexer/idb"
"github.com/algorand/indexer/v3/idb"
)

// Interval determines how often to delete data
Expand Down
6 changes: 3 additions & 3 deletions conduit/plugins/exporters/postgresql/util/prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/sirupsen/logrus/hooks/test"
"github.com/stretchr/testify/assert"

"github.com/algorand/indexer/idb"
"github.com/algorand/indexer/idb/postgres"
pgtest "github.com/algorand/indexer/idb/postgres/testing"
"github.com/algorand/indexer/v3/idb"
"github.com/algorand/indexer/v3/idb/postgres"
pgtest "github.com/algorand/indexer/v3/idb/postgres/testing"
)

var logger *logrus.Logger
Expand Down
41 changes: 21 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/algorand/go-algorand-sdk/v2 v2.2.0
github.com/algorand/go-codec/codec v1.1.10
github.com/algorand/indexer v0.0.0-20230601214318-cb2f42818f82
github.com/algorand/indexer/v3 v3.0.0
github.com/google/uuid v1.3.0
github.com/jackc/pgx/v4 v4.13.0
github.com/opensearch-project/opensearch-go/v2 v2.3.0
Expand All @@ -19,22 +19,23 @@ require (
)

require (
github.com/Microsoft/go-winio v0.4.14 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/algorand/avm-abi v0.2.0 // indirect
github.com/algorand/oapi-codegen v1.12.0-algorand.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v1.13.1 // indirect
github.com/docker/distribution v2.8.0+incompatible // indirect
github.com/docker/docker v23.0.4+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/getkin/kin-openapi v0.107.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.19.5 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/invopop/yaml v0.1.0 // indirect
Expand All @@ -48,17 +49,17 @@ require (
github.com/jackc/pgtype v1.8.1 // indirect
github.com/jackc/puddle v1.1.3 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/labstack/echo/v4 v4.9.1 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/lib/pq v1.10.2 // indirect
github.com/lib/pq v1.10.8 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
github.com/orlangure/gnomock v0.12.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/orlangure/gnomock v0.28.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand All @@ -69,14 +70,14 @@ require (
github.com/stretchr/objx v0.5.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading
Loading