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

Fix: compile error caused by unreachable package #4854

Merged
merged 7 commits into from
Apr 20, 2022
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
4 changes: 4 additions & 0 deletions app/submodule/network/libp2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func (noopLibP2PHost) ConnManager() connmgr.ConnManager {

type noopLibP2PNetwork struct{}

func (n noopLibP2PNetwork) ResourceManager() net.ResourceManager {
panic("implement me")
}

func (noopLibP2PNetwork) Peerstore() peerstore.Peerstore {
panic("implement me")
}
Expand Down
12 changes: 2 additions & 10 deletions app/submodule/network/network_submodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"fmt"
"os"
"path/filepath"
"runtime"
"time"

Expand Down Expand Up @@ -223,16 +222,9 @@ func NewNetworkSubmodule(ctx context.Context, config networkConfig) (*NetworkSub

dtNet := dtnet.NewFromLibp2pHost(peerHost)
dtDs := namespace.Wrap(config.Repo().ChainDatastore(), datastore.NewKey("/datatransfer/api/transfers"))
transport := dtgstransport.NewTransport(peerHost.ID(), gsync, dtn)
transport := dtgstransport.NewTransport(peerHost.ID(), gsync)

repoPath, err := config.Repo().Path()
if err != nil {
return nil, err
}

dirPath := filepath.Join(repoPath, "data-transfer")
_ = os.MkdirAll(dirPath, 0777) //todo fix for test
dt, err := dtimpl.NewDataTransfer(dtDs, dirPath, dtNet, transport)
dt, err := dtimpl.NewDataTransfer(dtDs, dtn, transport)
if err != nil {
return nil, err
}
Expand Down
60 changes: 12 additions & 48 deletions cmd/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ var addFundsCmd = &cmds.Command{
if err != nil {
return err
}
if err := re.Emit(chAddr); err != nil {
return err
}
return nil
return re.Emit(chAddr)
},
}

Expand All @@ -81,10 +78,7 @@ var listCmd = &cmds.Command{
if err != nil {
return err
}
if err := re.Emit(addrs); err != nil {
return err
}
return nil
return re.Emit(addrs)
},
}

Expand Down Expand Up @@ -129,10 +123,7 @@ var settleCmd = &cmds.Command{
if mwait.Receipt.ExitCode != 0 {
return xerrors.Errorf("settle message execution failed (exit code %d)", mwait.Receipt.ExitCode)
}
if err := re.Emit(fmt.Sprintf("Settled channel %s", chanAddr)); err != nil {
return err
}
return nil
return re.Emit(fmt.Sprintf("Settled channel %s", chanAddr))
},
}
var statusCmd = &cmds.Command{
Expand All @@ -155,10 +146,7 @@ var statusCmd = &cmds.Command{
//re.Emit(av)
w := bytes.NewBuffer(nil)
paychStatus(w, av)
if err := re.Emit(w); err != nil {
return err
}
return nil
return re.Emit(w)
},
}
var sbftCmd = &cmds.Command{
Expand All @@ -184,10 +172,7 @@ var sbftCmd = &cmds.Command{
}
w := bytes.NewBuffer(nil)
paychStatus(w, av)
if err := re.Emit(w); err != nil {
return err
}
return nil
return re.Emit(w)
},
}
var collectCmd = &cmds.Command{
Expand All @@ -214,10 +199,7 @@ var collectCmd = &cmds.Command{
return xerrors.Errorf("collect message execution failed (exit code %d)", mwait.Receipt.ExitCode)
}

if err := re.Emit(fmt.Sprintf("Collected funds for channel %s", chanAddr)); err != nil {
return err
}
return nil
return re.Emit(fmt.Sprintf("Collected funds for channel %s", chanAddr))
},
}

Expand Down Expand Up @@ -255,10 +237,7 @@ var voucherCreateCmd = &cmds.Command{
return err
}

if err := re.Emit(enc); err != nil {
return err
}
return nil
return re.Emit(enc)
},
}

Expand All @@ -283,10 +262,7 @@ var voucherCheckCmd = &cmds.Command{
if err != nil {
return err
}
if err := re.Emit("voucher is valid"); err != nil {
return err
}
return nil
return re.Emit("voucher is valid")
},
}

Expand All @@ -311,10 +287,7 @@ var voucherAddCmd = &cmds.Command{
if err != nil {
return err
}
if err := re.Emit("add voucher successfully"); err != nil {
return err
}
return nil
return re.Emit("add voucher successfully")
},
}

Expand Down Expand Up @@ -343,10 +316,7 @@ var voucherListCmd = &cmds.Command{
fmt.Fprintf(buff, "Lane %d, Nonce %d: %s, voucher: %s\n", v.Lane, v.Nonce, v.Amount.String(), str)
}

if err := re.Emit(buff); err != nil {
return err
}
return nil
return re.Emit(buff)
},
}

Expand Down Expand Up @@ -379,10 +349,7 @@ var voucherBestSpendableCmd = &cmds.Command{
}
fmt.Fprintf(buff, "Lane %d, Nonce %d: %s, voucher: %s\n", v.Lane, v.Nonce, v.Amount.String(), str)
}
if err := re.Emit(buff); err != nil {
return err
}
return nil
return re.Emit(buff)
},
}
var voucherSubmitCmd = &cmds.Command{
Expand Down Expand Up @@ -413,10 +380,7 @@ var voucherSubmitCmd = &cmds.Command{
if mwait.Receipt.ExitCode != 0 {
return xerrors.Errorf("message execution failed (exit code %d)", mwait.Receipt.ExitCode)
}
if err := re.Emit("channel updated successfully"); err != nil {
return err
}
return nil
return re.Emit("channel updated successfully")
},
}

Expand Down
32 changes: 6 additions & 26 deletions cmd/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ var genesisNewCmd = &cmds.Command{
return err
}

if err := ioutil.WriteFile(genf, genb, 0644); err != nil {
return err
}

return nil
return ioutil.WriteFile(genf, genb, 0644)
},
}

Expand Down Expand Up @@ -174,11 +170,7 @@ var genesisAddMinerCmd = &cmds.Command{
return err
}

if err := ioutil.WriteFile(genf, genb, 0644); err != nil {
return err
}

return nil
return ioutil.WriteFile(genf, genb, 0644)
},
}

Expand Down Expand Up @@ -244,10 +236,7 @@ var genesisAddMsigsCmd = &cmds.Command{
return err
}

if err := ioutil.WriteFile(genf, b, 0644); err != nil {
return err
}
return nil
return ioutil.WriteFile(genf, b, 0644)
},
}

Expand Down Expand Up @@ -411,10 +400,7 @@ var genesisSetVRKCmd = &cmds.Command{
return err
}

if err := ioutil.WriteFile(genf, b, 0644); err != nil {
return err
}
return nil
return ioutil.WriteFile(genf, b, 0644)
},
}

Expand Down Expand Up @@ -507,10 +493,7 @@ var genesisSetRemainderCmd = &cmds.Command{
return err
}

if err := ioutil.WriteFile(genf, b, 0644); err != nil {
return err
}
return nil
return ioutil.WriteFile(genf, b, 0644)
},
}

Expand Down Expand Up @@ -558,10 +541,7 @@ var genesisSetActorVersionCmd = &cmds.Command{
return err
}

if err := ioutil.WriteFile(genf, b, 0644); err != nil {
return err
}
return nil
return ioutil.WriteFile(genf, b, 0644)
},
}

Expand Down
5 changes: 1 addition & 4 deletions cmd/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,7 @@ func (idd *IDDetails) UnmarshalJSON(data []byte) error {
if err := decode(v, "ProtocolVersion", &idd.ProtocolVersion); err != nil {
return err
}
if err := decode(v, "PublicKey", &idd.PublicKey); err != nil {
return err
}
return nil
return decode(v, "PublicKey", &idd.PublicKey)
}

func decode(idd map[string]*json.RawMessage, key string, dest interface{}) error {
Expand Down
10 changes: 2 additions & 8 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ var storeStatusCmd = &cmds.Command{
count++
}

if err := re.Emit(w); err != nil {
return err
}
return nil
return re.Emit(w)
},
}

Expand Down Expand Up @@ -148,9 +145,6 @@ var historyCmd = &cmds.Command{
count++
}

if err := re.Emit(w); err != nil {
return err
}
return nil
return re.Emit(w)
},
}
35 changes: 17 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ require (
github.com/filecoin-project/go-cbor-util v0.0.1
github.com/filecoin-project/go-commp-utils v0.1.3
github.com/filecoin-project/go-crypto v0.0.1
github.com/filecoin-project/go-data-transfer v1.12.1
github.com/filecoin-project/go-data-transfer v1.15.1
github.com/filecoin-project/go-fil-commcid v0.1.0
github.com/filecoin-project/go-fil-markets v1.14.1
github.com/filecoin-project/go-fil-markets v1.20.1
github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec
github.com/filecoin-project/go-leb128 v0.0.0-20190212224330-8d79a5489543
github.com/filecoin-project/go-paramfetch v0.0.4
Expand All @@ -37,8 +37,8 @@ require (
github.com/filecoin-project/specs-actors/v4 v4.0.1
github.com/filecoin-project/specs-actors/v5 v5.0.4
github.com/filecoin-project/specs-actors/v6 v6.0.1
github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1
github.com/filecoin-project/specs-storage v0.2.0
github.com/filecoin-project/specs-actors/v7 v7.0.0
github.com/filecoin-project/specs-storage v0.2.2
github.com/filecoin-project/test-vectors/schema v0.0.5
github.com/filecoin-project/venus-auth v1.3.2
github.com/fxamacker/cbor/v2 v2.4.0
Expand Down Expand Up @@ -67,8 +67,8 @@ require (
github.com/ipfs/go-cid v0.1.0
github.com/ipfs/go-datastore v0.5.1
github.com/ipfs/go-ds-badger2 v0.1.2
github.com/ipfs/go-fs-lock v0.0.6
github.com/ipfs/go-graphsync v0.11.5
github.com/ipfs/go-fs-lock v0.0.7
github.com/ipfs/go-graphsync v0.13.1
github.com/ipfs/go-ipfs-blockstore v1.1.2
github.com/ipfs/go-ipfs-chunker v0.0.5
github.com/ipfs/go-ipfs-cmdkit v0.0.1
Expand All @@ -81,26 +81,26 @@ require (
github.com/ipfs/go-ipld-cbor v0.0.6
github.com/ipfs/go-ipld-format v0.2.0
github.com/ipfs/go-log v1.0.5
github.com/ipfs/go-log/v2 v2.4.0
github.com/ipfs/go-log/v2 v2.5.0
github.com/ipfs/go-merkledag v0.5.1
github.com/ipfs/go-path v0.0.7
github.com/ipfs/go-unixfs v0.2.6
github.com/ipfs/go-path v0.2.1
github.com/ipfs/go-unixfs v0.3.1
github.com/ipld/go-car v0.3.3
github.com/jbenet/goprocess v0.1.4
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/libp2p/go-eventbus v0.2.1
github.com/libp2p/go-libp2p v0.17.0
github.com/libp2p/go-libp2p-core v0.13.0
github.com/libp2p/go-libp2p v0.18.0-rc3
github.com/libp2p/go-libp2p-core v0.14.0
github.com/libp2p/go-libp2p-kad-dht v0.15.0
github.com/libp2p/go-libp2p-peerstore v0.6.0
github.com/libp2p/go-libp2p-pubsub v0.6.0
github.com/libp2p/go-libp2p-swarm v0.9.0
github.com/libp2p/go-libp2p-yamux v0.7.0
github.com/libp2p/go-libp2p-pubsub v0.6.1
github.com/libp2p/go-libp2p-swarm v0.10.1
github.com/libp2p/go-libp2p-yamux v0.8.1
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multiaddr v0.4.1
github.com/multiformats/go-multiaddr v0.5.0
github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/multiformats/go-multihash v0.1.0
github.com/onsi/gomega v1.15.0 // indirect
Expand All @@ -120,16 +120,15 @@ require (
github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/whyrusleeping/cbor-gen v0.0.0-20210713220151-be142a5ae1a8
github.com/whyrusleeping/cbor-gen v0.0.0-20220302191723-37c43cae8e14
github.com/whyrusleeping/go-logging v0.0.1
github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1
github.com/whyrusleeping/pubsub v0.0.0-20190708150250-92bcb0691325
github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.23.0
go.opentelemetry.io/otel/sdk v1.3.0 // indirect
go.uber.org/zap v1.19.1
golang.org/x/crypto v0.0.0-20210915214749-c084706c2272
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
Expand Down
Loading