From 718acb0a860ecf5bd2669842b58b29faec347744 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Thu, 19 Dec 2019 12:28:17 -0800 Subject: [PATCH 1/2] refactor(cborutil): extract cborutil library Use extracted cborutil library --- chain/actors/actor_storagemarket.go | 2 +- chain/blocksync/blocksync.go | 2 +- chain/blocksync/blocksync_client.go | 2 +- chain/deals/client.go | 2 +- chain/deals/client_states.go | 2 +- chain/deals/client_utils.go | 2 +- chain/deals/provider.go | 2 +- chain/deals/provider_asks.go | 2 +- chain/deals/provider_utils.go | 2 +- chain/deals/request_validation_test.go | 2 +- chain/deals/types.go | 2 +- chain/types/voucher.go | 2 +- cmd/lotus-storage-miner/init.go | 2 +- go.mod | 1 + go.sum | 2 + lib/cborutil/rpc.go | 80 -------------------------- lib/statestore/store.go | 2 +- lib/statestore/store_test.go | 2 +- node/hello/hello.go | 2 +- paych/store.go | 2 +- retrieval/client.go | 2 +- retrieval/miner.go | 2 +- storage/sectorblocks/blocks.go | 2 +- storage/sectors_test.go | 2 +- 24 files changed, 24 insertions(+), 101 deletions(-) delete mode 100644 lib/cborutil/rpc.go diff --git a/chain/actors/actor_storagemarket.go b/chain/actors/actor_storagemarket.go index 22249e430..03fbda912 100644 --- a/chain/actors/actor_storagemarket.go +++ b/chain/actors/actor_storagemarket.go @@ -16,7 +16,7 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors/aerrors" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/sectorbuilder" ) diff --git a/chain/blocksync/blocksync.go b/chain/blocksync/blocksync.go index b144000d3..1fc4409d3 100644 --- a/chain/blocksync/blocksync.go +++ b/chain/blocksync/blocksync.go @@ -10,7 +10,7 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" diff --git a/chain/blocksync/blocksync_client.go b/chain/blocksync/blocksync_client.go index 8de89de57..c4a0c230a 100644 --- a/chain/blocksync/blocksync_client.go +++ b/chain/blocksync/blocksync_client.go @@ -20,7 +20,7 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/peermgr" ) diff --git a/chain/deals/client.go b/chain/deals/client.go index daa3063ce..8af8b9a7b 100644 --- a/chain/deals/client.go +++ b/chain/deals/client.go @@ -19,7 +19,7 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" "github.com/filecoin-project/lotus/node/impl/full" "github.com/filecoin-project/lotus/node/modules/dtypes" diff --git a/chain/deals/client_states.go b/chain/deals/client_states.go index 23643b058..2de16733d 100644 --- a/chain/deals/client_states.go +++ b/chain/deals/client_states.go @@ -11,7 +11,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" ) type clientHandlerFunc func(ctx context.Context, deal ClientDeal) (func(*ClientDeal), error) diff --git a/chain/deals/client_utils.go b/chain/deals/client_utils.go index 2d80c6734..fb6abd6a3 100644 --- a/chain/deals/client_utils.go +++ b/chain/deals/client_utils.go @@ -13,7 +13,7 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/lotus/datatransfer" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/padreader" "github.com/filecoin-project/lotus/lib/sectorbuilder" "github.com/filecoin-project/lotus/lib/statestore" diff --git a/chain/deals/provider.go b/chain/deals/provider.go index 518535939..e4ccbb6e9 100644 --- a/chain/deals/provider.go +++ b/chain/deals/provider.go @@ -17,7 +17,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/datatransfer" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/storage" diff --git a/chain/deals/provider_asks.go b/chain/deals/provider_asks.go index 4bc50ca39..f74a1fc63 100644 --- a/chain/deals/provider_asks.go +++ b/chain/deals/provider_asks.go @@ -8,7 +8,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" datastore "github.com/ipfs/go-datastore" inet "github.com/libp2p/go-libp2p-core/network" "golang.org/x/xerrors" diff --git a/chain/deals/provider_utils.go b/chain/deals/provider_utils.go index b9b8eaa73..79f555662 100644 --- a/chain/deals/provider_utils.go +++ b/chain/deals/provider_utils.go @@ -13,7 +13,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" "github.com/ipfs/go-cid" diff --git a/chain/deals/request_validation_test.go b/chain/deals/request_validation_test.go index b035ebc6a..62dde93aa 100644 --- a/chain/deals/request_validation_test.go +++ b/chain/deals/request_validation_test.go @@ -18,7 +18,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/deals" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" ) diff --git a/chain/deals/types.go b/chain/deals/types.go index e71d35b35..df7ffd3e9 100644 --- a/chain/deals/types.go +++ b/chain/deals/types.go @@ -8,7 +8,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/ipfs/go-cid" ) diff --git a/chain/types/voucher.go b/chain/types/voucher.go index 8631ff40c..75aec5559 100644 --- a/chain/types/voucher.go +++ b/chain/types/voucher.go @@ -4,8 +4,8 @@ import ( "bytes" "encoding/base64" + cborrpc "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/go-address" - cborrpc "github.com/filecoin-project/lotus/lib/cborutil" cbor "github.com/ipfs/go-ipld-cbor" ) diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index 280094aa6..80da8a50f 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -28,7 +28,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" "github.com/filecoin-project/lotus/genesis" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/sectorbuilder" "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node/modules" diff --git a/go.mod b/go.mod index 2b806dfda..c0bf799d6 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/filecoin-project/filecoin-ffi v0.0.0-20191213130254-f261762ff8ed github.com/filecoin-project/go-address v0.0.0-20191219011437-af739c490b4f github.com/filecoin-project/go-amt-ipld v0.0.0-20191205011053-79efc22d6cdc + github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 github.com/filecoin-project/go-paramfetch v0.0.0-20200102181131-b20d579f2878 github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1 diff --git a/go.sum b/go.sum index d9141b3d6..3f09e3afb 100644 --- a/go.sum +++ b/go.sum @@ -89,6 +89,8 @@ github.com/filecoin-project/go-paramfetch v0.0.0-20200102181131-b20d579f2878 h1: github.com/filecoin-project/go-paramfetch v0.0.0-20200102181131-b20d579f2878/go.mod h1:40kI2Gv16mwcRsHptI3OAV4nlOEU7wVDc4RgMylNFjU= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= +github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8= +github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1 h1:EzDjxMg43q1tA2c0MV3tNbaontnHLplHyFF6M5KiVP0= diff --git a/lib/cborutil/rpc.go b/lib/cborutil/rpc.go deleted file mode 100644 index 06af9a156..000000000 --- a/lib/cborutil/rpc.go +++ /dev/null @@ -1,80 +0,0 @@ -package cborutil - -import ( - "bytes" - "encoding/hex" - "io" - "math" - - cbor "github.com/ipfs/go-ipld-cbor" - ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" - cbg "github.com/whyrusleeping/cbor-gen" -) - -var log = logging.Logger("cborrrpc") - -const Debug = false - -func init() { - if Debug { - log.Warn("CBOR-RPC Debugging enabled") - } -} - -func WriteCborRPC(w io.Writer, obj interface{}) error { - if m, ok := obj.(cbg.CBORMarshaler); ok { - // TODO: impl debug - return m.MarshalCBOR(w) - } - data, err := cbor.DumpObject(obj) - if err != nil { - return err - } - - if Debug { - log.Infof("> %s", hex.EncodeToString(data)) - } - - _, err = w.Write(data) - return err -} - -func ReadCborRPC(r io.Reader, out interface{}) error { - if um, ok := out.(cbg.CBORUnmarshaler); ok { - return um.UnmarshalCBOR(r) - } - return cbor.DecodeReader(r, out) -} - -func Dump(obj interface{}) ([]byte, error) { - var out bytes.Buffer - if err := WriteCborRPC(&out, obj); err != nil { - return nil, err - } - return out.Bytes(), nil -} - -// TODO: this is a bit ugly, and this package is not exactly the best place -func AsIpld(obj interface{}) (ipld.Node, error) { - if m, ok := obj.(cbg.CBORMarshaler); ok { - b, err := Dump(m) - if err != nil { - return nil, err - } - return cbor.Decode(b, math.MaxUint64, -1) - } - return cbor.WrapObject(obj, math.MaxUint64, -1) -} - -func Equals(a cbg.CBORMarshaler, b cbg.CBORMarshaler) (bool, error) { - ab, err := Dump(a) - if err != nil { - return false, err - } - bb, err := Dump(b) - if err != nil { - return false, err - } - return bytes.Equal(ab, bb), nil -} diff --git a/lib/statestore/store.go b/lib/statestore/store.go index a334b60b8..38ce17b39 100644 --- a/lib/statestore/store.go +++ b/lib/statestore/store.go @@ -11,7 +11,7 @@ import ( "go.uber.org/multierr" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" ) type StateStore struct { diff --git a/lib/statestore/store_test.go b/lib/statestore/store_test.go index 91724bbf8..b3529a559 100644 --- a/lib/statestore/store_test.go +++ b/lib/statestore/store_test.go @@ -6,7 +6,7 @@ import ( "github.com/ipfs/go-datastore" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" ) func TestList(t *testing.T) { diff --git a/node/hello/hello.go b/node/hello/hello.go index 6d84b4e3e..51bfd4335 100644 --- a/node/hello/hello.go +++ b/node/hello/hello.go @@ -15,7 +15,7 @@ import ( "github.com/filecoin-project/lotus/chain" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/peermgr" ) diff --git a/paych/store.go b/paych/store.go index b9c5d075c..c827006f0 100644 --- a/paych/store.go +++ b/paych/store.go @@ -14,7 +14,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/lotus/chain/types" - cborrpc "github.com/filecoin-project/lotus/lib/cborutil" + cborrpc "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/node/modules/dtypes" ) diff --git a/retrieval/client.go b/retrieval/client.go index abe76f4e1..02816c0da 100644 --- a/retrieval/client.go +++ b/retrieval/client.go @@ -17,7 +17,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" payapi "github.com/filecoin-project/lotus/node/impl/paych" "github.com/filecoin-project/lotus/paych" "github.com/filecoin-project/lotus/retrieval/discovery" diff --git a/retrieval/miner.go b/retrieval/miner.go index 98563b7f9..a420b5c5a 100644 --- a/retrieval/miner.go +++ b/retrieval/miner.go @@ -15,7 +15,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/storage/sectorblocks" ) diff --git a/storage/sectorblocks/blocks.go b/storage/sectorblocks/blocks.go index efdbe6ae5..a900a9be0 100644 --- a/storage/sectorblocks/blocks.go +++ b/storage/sectorblocks/blocks.go @@ -19,7 +19,7 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/padreader" "github.com/filecoin-project/lotus/lib/sectorbuilder" "github.com/filecoin-project/lotus/node/modules/dtypes" diff --git a/storage/sectors_test.go b/storage/sectors_test.go index 858e3876e..111a00aed 100644 --- a/storage/sectors_test.go +++ b/storage/sectors_test.go @@ -6,7 +6,7 @@ import ( "gotest.tools/assert" - "github.com/filecoin-project/lotus/lib/cborutil" + "github.com/filecoin-project/go-cbor-util" ) func TestSectorInfoSelialization(t *testing.T) { From 1e7f10e387ae3b1c0ed755933eb45b8fa27f0727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 7 Jan 2020 15:00:10 +0100 Subject: [PATCH 2/2] gofmt --- chain/actors/actor_storagemarket.go | 2 +- chain/blocksync/blocksync.go | 2 +- chain/blocksync/blocksync_client.go | 2 +- chain/deals/client.go | 2 +- chain/deals/client_states.go | 2 +- chain/deals/client_utils.go | 2 +- chain/deals/provider.go | 2 +- chain/deals/provider_asks.go | 2 +- chain/deals/provider_utils.go | 2 +- chain/deals/request_validation_test.go | 2 +- chain/deals/types.go | 2 +- chain/types/voucher.go | 2 +- cmd/lotus-storage-miner/init.go | 2 +- lib/statestore/store_test.go | 2 +- node/hello/hello.go | 2 +- paych/store.go | 2 +- retrieval/client.go | 2 +- retrieval/miner.go | 2 +- storage/sectorblocks/blocks.go | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/chain/actors/actor_storagemarket.go b/chain/actors/actor_storagemarket.go index 03fbda912..526099e00 100644 --- a/chain/actors/actor_storagemarket.go +++ b/chain/actors/actor_storagemarket.go @@ -13,10 +13,10 @@ import ( "github.com/ipfs/go-hamt-ipld" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors/aerrors" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/sectorbuilder" ) diff --git a/chain/blocksync/blocksync.go b/chain/blocksync/blocksync.go index 1fc4409d3..429ad2ce1 100644 --- a/chain/blocksync/blocksync.go +++ b/chain/blocksync/blocksync.go @@ -8,9 +8,9 @@ import ( "go.opencensus.io/trace" "golang.org/x/xerrors" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" diff --git a/chain/blocksync/blocksync_client.go b/chain/blocksync/blocksync_client.go index c4a0c230a..ef5e370c8 100644 --- a/chain/blocksync/blocksync_client.go +++ b/chain/blocksync/blocksync_client.go @@ -18,9 +18,9 @@ import ( "go.opencensus.io/trace" "golang.org/x/xerrors" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/peermgr" ) diff --git a/chain/deals/client.go b/chain/deals/client.go index 8af8b9a7b..afbb317f0 100644 --- a/chain/deals/client.go +++ b/chain/deals/client.go @@ -11,6 +11,7 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/events" @@ -19,7 +20,6 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" "github.com/filecoin-project/lotus/node/impl/full" "github.com/filecoin-project/lotus/node/modules/dtypes" diff --git a/chain/deals/client_states.go b/chain/deals/client_states.go index 2de16733d..d19765f60 100644 --- a/chain/deals/client_states.go +++ b/chain/deals/client_states.go @@ -6,12 +6,12 @@ import ( "golang.org/x/xerrors" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" ) type clientHandlerFunc func(ctx context.Context, deal ClientDeal) (func(*ClientDeal), error) diff --git a/chain/deals/client_utils.go b/chain/deals/client_utils.go index fb6abd6a3..256738366 100644 --- a/chain/deals/client_utils.go +++ b/chain/deals/client_utils.go @@ -12,8 +12,8 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/datatransfer" "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/lotus/datatransfer" "github.com/filecoin-project/lotus/lib/padreader" "github.com/filecoin-project/lotus/lib/sectorbuilder" "github.com/filecoin-project/lotus/lib/statestore" diff --git a/chain/deals/provider.go b/chain/deals/provider.go index e4ccbb6e9..a12f9fa07 100644 --- a/chain/deals/provider.go +++ b/chain/deals/provider.go @@ -13,11 +13,11 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/datatransfer" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/storage" diff --git a/chain/deals/provider_asks.go b/chain/deals/provider_asks.go index f74a1fc63..1170eb28b 100644 --- a/chain/deals/provider_asks.go +++ b/chain/deals/provider_asks.go @@ -6,9 +6,9 @@ import ( "time" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" datastore "github.com/ipfs/go-datastore" inet "github.com/libp2p/go-libp2p-core/network" "golang.org/x/xerrors" diff --git a/chain/deals/provider_utils.go b/chain/deals/provider_utils.go index 79f555662..c3e77b760 100644 --- a/chain/deals/provider_utils.go +++ b/chain/deals/provider_utils.go @@ -11,9 +11,9 @@ import ( "github.com/ipld/go-ipld-prime" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" "github.com/ipfs/go-cid" diff --git a/chain/deals/request_validation_test.go b/chain/deals/request_validation_test.go index 62dde93aa..c0bb34e03 100644 --- a/chain/deals/request_validation_test.go +++ b/chain/deals/request_validation_test.go @@ -14,11 +14,11 @@ import ( xerrors "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/deals" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/statestore" ) diff --git a/chain/deals/types.go b/chain/deals/types.go index df7ffd3e9..8a368e80d 100644 --- a/chain/deals/types.go +++ b/chain/deals/types.go @@ -5,10 +5,10 @@ import ( "errors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/ipfs/go-cid" ) diff --git a/chain/types/voucher.go b/chain/types/voucher.go index 75aec5559..ba2bab6ec 100644 --- a/chain/types/voucher.go +++ b/chain/types/voucher.go @@ -4,8 +4,8 @@ import ( "bytes" "encoding/base64" - cborrpc "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/go-address" + cborrpc "github.com/filecoin-project/go-cbor-util" cbor "github.com/ipfs/go-ipld-cbor" ) diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index 80da8a50f..0f2a83d39 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -21,6 +21,7 @@ import ( "gopkg.in/urfave/cli.v2" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" lapi "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors" @@ -28,7 +29,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" "github.com/filecoin-project/lotus/genesis" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/lib/sectorbuilder" "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node/modules" diff --git a/lib/statestore/store_test.go b/lib/statestore/store_test.go index b3529a559..b0aa366d1 100644 --- a/lib/statestore/store_test.go +++ b/lib/statestore/store_test.go @@ -5,8 +5,8 @@ import ( "github.com/ipfs/go-datastore" - "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/lotus/chain/types" ) func TestList(t *testing.T) { diff --git a/node/hello/hello.go b/node/hello/hello.go index 51bfd4335..d05e0a0c8 100644 --- a/node/hello/hello.go +++ b/node/hello/hello.go @@ -12,10 +12,10 @@ import ( "github.com/libp2p/go-libp2p-core/peer" protocol "github.com/libp2p/go-libp2p-core/protocol" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/chain" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/peermgr" ) diff --git a/paych/store.go b/paych/store.go index c827006f0..f5e74b843 100644 --- a/paych/store.go +++ b/paych/store.go @@ -13,8 +13,8 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/chain/types" cborrpc "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/node/modules/dtypes" ) diff --git a/retrieval/client.go b/retrieval/client.go index 02816c0da..bd06c4d3b 100644 --- a/retrieval/client.go +++ b/retrieval/client.go @@ -14,10 +14,10 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" payapi "github.com/filecoin-project/lotus/node/impl/paych" "github.com/filecoin-project/lotus/paych" "github.com/filecoin-project/lotus/retrieval/discovery" diff --git a/retrieval/miner.go b/retrieval/miner.go index a420b5c5a..c9b54c5ec 100644 --- a/retrieval/miner.go +++ b/retrieval/miner.go @@ -12,10 +12,10 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/storage/sectorblocks" ) diff --git a/storage/sectorblocks/blocks.go b/storage/sectorblocks/blocks.go index a900a9be0..a2ee78053 100644 --- a/storage/sectorblocks/blocks.go +++ b/storage/sectorblocks/blocks.go @@ -18,8 +18,8 @@ import ( "github.com/ipfs/go-unixfs" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/lib/padreader" "github.com/filecoin-project/lotus/lib/sectorbuilder" "github.com/filecoin-project/lotus/node/modules/dtypes"