Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
urvisavla committed Jan 19, 2024
1 parent 5cbd084 commit d3955e6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions exp/services/ledgerexporter/internal/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (a *App) Run() {
}

func NewDestinationStorage(config *Config) storage.Storage {
destinationStorage, err := storage.ConnectBackend(config.DestinationUrl, storage.ConnectOptions{})
destinationStorage, err := storage.ConnectBackend(config.DestinationURL, storage.ConnectOptions{})
logFatalIf(err, "Could not connect to destination storage")
return destinationStorage
}
Expand All @@ -131,7 +131,7 @@ func NewLedgerBackend(config Config) ledgerbackend.LedgerBackend {
params := ledgerbackend.CaptiveCoreTomlParams{
NetworkPassphrase: coreConfig.NetworkPassphrase,
HistoryArchiveURLs: coreConfig.HistoryArchiveUrls,
UseDB: coreConfig.CaptiveCoreUseDb,
UseDB: coreConfig.CaptiveCoreUseDB,
}
if coreConfig.CaptiveCoreTomlPath == "" {
logger.Fatal("Missing captive_core_toml_path in the config")
Expand All @@ -147,7 +147,7 @@ func NewLedgerBackend(config Config) ledgerbackend.LedgerBackend {
CheckpointFrequency: 64,
Log: logger.WithField("subservice", "stellar-core"),
Toml: captiveCoreToml,
UseDB: coreConfig.CaptiveCoreUseDb,
UseDB: coreConfig.CaptiveCoreUseDB,
}

// Create a new captive core backend
Expand Down
4 changes: 2 additions & 2 deletions exp/services/ledgerexporter/internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ type StellarCoreConfig struct {
HistoryArchiveUrls []string `toml:"history_archive_urls"`
StellarCoreBinaryPath string `toml:"stellar_core_binary_path"`
CaptiveCoreTomlPath string `toml:"captive_core_toml_path"`
CaptiveCoreUseDb bool `toml:"captive_core_use_db"`
CaptiveCoreUseDB bool `toml:"captive_core_use_db"`
}

type Config struct {
Network string `toml:"network"`
DestinationUrl string `toml:"destination_url"`
DestinationURL string `toml:"destination_url"`
ExporterConfig ExporterConfig `toml:"exporter_config"`
StellarCoreConfig StellarCoreConfig `toml:"stellar_core_config"`

Expand Down
3 changes: 2 additions & 1 deletion exp/services/ledgerexporter/internal/config_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package exporter

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestInvalidEndLedgerBoundedMode(t *testing.T) {
Expand Down
8 changes: 5 additions & 3 deletions exp/services/ledgerexporter/internal/exportmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/stellar/go/ingest/ledgerbackend"
"github.com/stellar/go/support/collections/set"
"github.com/stellar/go/xdr"
_ "github.com/stellar/go/xdr"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
Expand Down Expand Up @@ -65,7 +64,9 @@ func (s *ExportManagerSuite) TestRun() {
}
}()

exporter.Run(s.ctx, uint32(start), uint32(end))
err := exporter.Run(s.ctx, uint32(start), uint32(end))
assert.NoError(s.T(), err)

wg.Wait()

assert.Equal(s.T(), expectedObjectkeys, actualObjectKeys)
Expand All @@ -91,7 +92,7 @@ func (s *ExportManagerSuite) TestAddLedgerCloseMeta() {
start := 0
end := 255
for i := start; i <= end; i++ {
exporter.AddLedgerCloseMeta(xdr.LedgerCloseMeta{
err := exporter.AddLedgerCloseMeta(xdr.LedgerCloseMeta{
V0: &xdr.LedgerCloseMetaV0{
LedgerHeader: xdr.LedgerHeaderHistoryEntry{
Header: xdr.LedgerHeader{
Expand All @@ -100,6 +101,7 @@ func (s *ExportManagerSuite) TestAddLedgerCloseMeta() {
},
},
})
assert.NoError(s.T(), err)
key, _ := config.getObjectKey(uint32(i))
expectedObjectkeys.Add(key)
}
Expand Down
3 changes: 2 additions & 1 deletion support/storage/mock_storage.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package storage

import (
"github.com/stretchr/testify/mock"
"io"

"github.com/stretchr/testify/mock"
)

// MockStorage is a mock implementation for the Storage interface.
Expand Down

0 comments on commit d3955e6

Please sign in to comment.