Skip to content

Commit

Permalink
Merge pull request #506 from OdyseeTeam/fix-upgrade
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
anbsky committed Jan 30, 2024
2 parents 44b8204 + 5ba0449 commit 4c615a9
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 72 deletions.
4 changes: 0 additions & 4 deletions app/wallet/wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,6 @@ func TestAssignSDKServerToUser_ConcurrentUpdates(t *testing.T) {
assert.Equal(t, s1.ID, u.LbrynetServerID.Int)
}

func TestCreate_CorrectWalletID(t *testing.T) {
// TODO: test that calling Create() sends the correct wallet id to the server
}

func TestInitializeWallet(t *testing.T) {
rand.Seed(time.Now().UnixNano())
userID := rand.Int()
Expand Down
2 changes: 1 addition & 1 deletion docker/daemon_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data_dir: /storage/lbrynet
download_dir: /storage/download
wallet_dir: /storage/lbryum

# lbryum_servers: []
lbryum_servers: ["a-hub1.odysee.com:50001"]

save_blobs: false
save_files: false
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ require (
github.com/lbryio/lbry.go/v3 v3.0.1-beta
github.com/lbryio/reflector.go v1.1.3-0.20220730181028-f5d30b1a6e79
github.com/lbryio/types v0.0.0-20220224142228-73610f6654a6
github.com/lestrrat-go/jwx/v2 v2.0.11
github.com/lestrrat-go/jwx/v2 v2.0.19
github.com/lib/pq v1.10.7
github.com/mitchellh/mapstructure v1.5.0
github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6
github.com/ory/dockertest/v3 v3.9.1
github.com/ory/dockertest/v3 v3.10.0
github.com/oschwald/geoip2-golang v1.5.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
Expand Down Expand Up @@ -67,7 +67,7 @@ require (

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
Expand Down Expand Up @@ -106,8 +106,8 @@ require (
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 // indirect
github.com/dimfeld/httptreemux/v5 v5.3.0 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/docker v23.0.3+incompatible // indirect
github.com/docker/cli v24.0.1+incompatible // indirect
github.com/docker/docker v24.0.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
Expand Down Expand Up @@ -138,7 +138,7 @@ require (
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -149,7 +149,7 @@ require (
github.com/lbryio/chainquery v1.9.0 // indirect
github.com/lbryio/lbry.go v1.1.2 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.4 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
Expand Down Expand Up @@ -194,13 +194,13 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
Expand Down
59 changes: 26 additions & 33 deletions go.sum

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions internal/monitor/module_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/sirupsen/logrus"
)

// TODO: we could drop the custom struct completely. it doesnt add anything anymore
// ModuleLogger contains module-specific logger details.
type ModuleLogger struct {
Entry *logrus.Entry
Expand All @@ -33,7 +32,8 @@ func NewModuleLogger(moduleName string) ModuleLogger {
// WithFields returns a new log entry containing additional info provided by fields,
// which can be called upon with a corresponding logLevel.
// Example:
// logger.WithFields(F{"query": "..."}).Info("query error")
//
// logger.WithFields(F{"query": "..."}).Info("query error")
func (m ModuleLogger) WithFields(fields logrus.Fields) *logrus.Entry {
if v, ok := fields[TokenF]; ok && v != "" && isProduction() {
fields[TokenF] = valueMask
Expand All @@ -44,7 +44,8 @@ func (m ModuleLogger) WithFields(fields logrus.Fields) *logrus.Entry {
// Log returns a new log entry for the module
// which can be called upon with a corresponding logLevel.
// Example:
// Log().Info("query error")
//
// Log().Info("query error")
func (m ModuleLogger) Log() *logrus.Entry {
return m.Entry.WithFields(nil)
}
Expand Down
35 changes: 18 additions & 17 deletions pkg/fileanalyzer/fileanalyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"context"
"errors"
"io"
"io/ioutil"
"net/http"
"os"
"testing"

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

const testAssetsURL = "https://odytestassets.s3.us-east-2.amazonaws.com/"

type analyzerSuite struct {
suite.Suite
}
Expand All @@ -26,14 +27,14 @@ func (s *analyzerSuite) SetupSuite() {

func (s *analyzerSuite) TestAnalyze() {
cases := []struct {
kind, url string
kind, file string
meta *MediaInfo
getMediaInfoError error
mimeName, mimeType, ext string
}{
{
kind: "audio",
url: "https://getsamplefiles.com/download/mp3/96k",
kind: "MP3 audio",
file: "96k",
meta: &MediaInfo{
Duration: 45,
Width: 0,
Expand All @@ -44,8 +45,8 @@ func (s *analyzerSuite) TestAnalyze() {
ext: ".mp3",
},
{
kind: "mov video",
url: "https://ik.imagekit.io/odystatic/hdreel.mov",
kind: "MOV video",
file: "hdreel.mov",
meta: &MediaInfo{
Duration: 29,
Width: 1920,
Expand All @@ -56,8 +57,8 @@ func (s *analyzerSuite) TestAnalyze() {
ext: ".avi",
},
{
kind: "video",
url: "https://filesamples.com/samples/video/avi/sample_960x400_ocean_with_audio.avi",
kind: "AVI video",
file: "sample_960x400_ocean_with_audio.avi",
meta: &MediaInfo{
Duration: 46,
Width: 960,
Expand All @@ -69,7 +70,7 @@ func (s *analyzerSuite) TestAnalyze() {
},
{
kind: "JPEG",
url: "https://photographylife.com/wp-content/uploads/2018/11/Moeraki-Boulders-New-Zealand.jpg",
file: "Moeraki-Boulders-New-Zealand.jpg",
meta: &MediaInfo{
Width: 2048,
Height: 1365,
Expand All @@ -79,15 +80,15 @@ func (s *analyzerSuite) TestAnalyze() {
ext: ".jpg",
},
{
kind: "doc",
url: "https://filesamples.com/samples/document/doc/sample2.doc",
kind: "DOC",
file: "sample2.doc",
getMediaInfoError: errors.New("no media info for 'document' type"),
mimeName: "document",
ext: ".doc",
},
{
kind: "bin",
url: "http://speedtest.ftp.otenet.gr/files/test1Mb.db",
kind: "binary file",
file: "test1Mb.db",
getMediaInfoError: errors.New("no media info for 'binary' type"),
mimeName: "binary",
mimeType: "application/octet-stream",
Expand All @@ -97,7 +98,7 @@ func (s *analyzerSuite) TestAnalyze() {

for _, c := range cases {
s.Run(c.kind, func() {
filePath := s.getTestAsset(c.url)
filePath := s.getTestAsset(c.file)
f, err := os.Open(filePath)
s.Require().NoError(err)
defer f.Close()
Expand All @@ -118,12 +119,12 @@ func (s *analyzerSuite) TestAnalyze() {
}
}

func (s *analyzerSuite) getTestAsset(url string) string {
r, err := http.Get(url)
func (s *analyzerSuite) getTestAsset(file string) string {
r, err := http.Get(testAssetsURL + file)
s.Require().NoError(err)
defer r.Body.Close()
s.Require().Equal(http.StatusOK, r.StatusCode)
f, err := ioutil.TempFile(s.T().TempDir(), "")
f, err := os.CreateTemp(s.T().TempDir(), "")
s.Require().NoError(err)
defer f.Close()
_, err = io.Copy(f, r.Body)
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Make sure you have recent enough Docker and `docker-compose` installed.

This will pull and launch SDK and postgres images, which Odysee API requires to operate.

`docker-compose -f docker-compose.yaml -f docker-compose.app.yml up -d`
`docker-compose -f docker-compose.yml -f docker-compose.app.yml up -d`

*Note: if you're running a LBRY desktop app or lbrynet instance, you will have to either shut it down or change ports*

Expand Down
2 changes: 1 addition & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module _tools

go 1.16
go 1.20

require (
github.com/mattn/goveralls v0.0.9
Expand Down

0 comments on commit 4c615a9

Please sign in to comment.