diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index a0d052371..06408a0f0 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -62,7 +62,7 @@ func (fsr *FsRepo) Init() error { log.Infof("Initializing repo at '%s'", fsr.path) - return os.Mkdir(fsr.path, 0755) // nolint + return os.Mkdir(fsr.path, 0755) //nolint: gosec } // APIEndpoint returns endpoint of API in this repo diff --git a/node/repo/repo_test.go b/node/repo/repo_test.go index 2e90534a8..2e39e1dcc 100644 --- a/node/repo/repo_test.go +++ b/node/repo/repo_test.go @@ -5,6 +5,8 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/assert" + + "github.com/filecoin-project/go-lotus/node/config" ) func basicTest(t *testing.T, repo Repo) { @@ -43,6 +45,14 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "setting multiaddr shouldn't error") assert.Equal(t, ma, apima, "returned API multiaddr should be the same") + iden, err := lrepo.Libp2pIdentity() + assert.NotNil(t, iden, "identity is not nil") + assert.NoError(t, err, "identity should not error") + + cfg, err := lrepo.Config() + assert.Equal(t, config.Default(), cfg, "there should be a default config") + assert.NoError(t, err, "config should not error") + err = lrepo.Close() assert.NoError(t, err, "should be able to close")