Skip to content

Commit

Permalink
Merge pull request #57 from gfanton/feat/update-kubo
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton authored Apr 20, 2023
2 parents 584d513 + 46b4708 commit 4ad62f5
Show file tree
Hide file tree
Showing 26 changed files with 463 additions and 592 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#-----
# golang 1.18.4 is simply the most recent version available to date (07/22).
# golang golang 1.19.7 is simply the most recent version available to date (03/30).
# There is no contraindication for updating it.
#-----
golang 1.18.4
golang 1.19.7

#-----
# golangci-lint 1.51.2 is simply the most recent version available to date (07/22).
Expand Down
5 changes: 2 additions & 3 deletions account_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"archive/tar"
"context"
"io"
"io/ioutil"
"os"
"testing"

Expand Down Expand Up @@ -44,7 +43,7 @@ func Test_service_exportAccountKeys(t *testing.T) {
s, ok := nodeA.Service.(*service)
require.True(t, ok)

tmpFile, err := ioutil.TempFile(os.TempDir(), "test-export-")
tmpFile, err := os.CreateTemp(os.TempDir(), "test-export-")
require.NoError(t, err)

defer os.Remove(tmpFile.Name())
Expand Down Expand Up @@ -99,7 +98,7 @@ func TestRestoreAccount(t *testing.T) {

msrv := tinder.NewMockDriverServer()

tmpFile, err := ioutil.TempFile(os.TempDir(), "test-export-")
tmpFile, err := os.CreateTemp(os.TempDir(), "test-export-")
require.NoError(t, err)

expectedMessages := map[cid.Cid][]byte{}
Expand Down
4 changes: 2 additions & 2 deletions api_services_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
Expand Down Expand Up @@ -112,7 +112,7 @@ func (s *service) AuthServiceCompleteFlow(ctx context.Context, request *protocol
return nil, errcode.ErrServicesAuthInvalidResponse.Wrap(fmt.Errorf("invalid status code %d", res.StatusCode))
}

body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
return nil, errcode.ErrStreamRead.Wrap(err)
}
Expand Down
20 changes: 18 additions & 2 deletions blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package weshnet_test
import (
"context"
"fmt"
"io/ioutil"
"os"
"testing"

Expand Down Expand Up @@ -40,6 +39,9 @@ func TestTestingClient_impl(t *testing.T) {
}

func ExampleNewInMemoryServiceClient_basic() {
// disable ressources manager for test
os.Setenv("LIBP2P_RCMGR", "false")

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand All @@ -61,15 +63,19 @@ func ExampleNewInMemoryServiceClient_basic() {
}

// Output:
// go-libp2p resource manager protection disabled
// /p2p-circuit
}

func ExampleNewPersistentServiceClient_basic() {
// disable ressources manager for test
os.Setenv("LIBP2P_RCMGR", "false")

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

// create a temporary path to host data of our persistant service
path, err := ioutil.TempDir("", "weshnet-test-persistant")
path, err := os.MkdirTemp("", "weshnet-test-persistant")
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -114,9 +120,14 @@ func ExampleNewPersistentServiceClient_basic() {
}

// Output:
// go-libp2p resource manager protection disabled
// go-libp2p resource manager protection disabled
}

func ExampleNewServiceClient_basic() {
// disable ressources manager for test
os.Setenv("LIBP2P_RCMGR", "false")

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand All @@ -138,10 +149,14 @@ func ExampleNewServiceClient_basic() {
}

// Output:
// go-libp2p resource manager protection disabled
// /p2p-circuit
}

func ExampleNewService_basic() {
// disable ressources manager for test
os.Setenv("LIBP2P_RCMGR", "false")

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand All @@ -163,6 +178,7 @@ func ExampleNewService_basic() {
}

// Output:
// go-libp2p resource manager protection disabled
// /p2p-circuit
}

Expand Down
Loading

0 comments on commit 4ad62f5

Please sign in to comment.