Skip to content

Commit

Permalink
some updates after rebase with master
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonwells committed Jan 10, 2020
1 parent b2d8abf commit bb5e2ac
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 28 deletions.
10 changes: 0 additions & 10 deletions retrievalmarket/impl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,6 @@ func (c *client) Retrieve(ctx context.Context, pieceCID []byte, params retrieval

go func() {
evt := retrievalmarket.ClientEventError
//converted, err := cid.Cast(pieceCID)

/*if err == nil {
err = c.retrieveUnixfs(ctx, converted, tokenamount.Div(totalFunds, params.PricePerByte).Uint64(), totalFunds, miner, clientWallet, minerWallet)
if err == nil {
evt = retrievalmarket.ClientEventComplete
dealState.Status = retrievalmarket.DealStatusCompleted
}
}*/

c.notifySubscribers(evt, dealState)
}()

Expand Down
2 changes: 1 addition & 1 deletion retrievalmarket/impl/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
retrievalimpl "github.com/filecoin-project/go-fil-components/retrievalmarket/impl"
"github.com/filecoin-project/go-fil-components/retrievalmarket/network"
rmnet "github.com/filecoin-project/go-fil-components/retrievalmarket/network"
tut "github.com/filecoin-project/go-fil-components/retrievalmarket/network/testutil"
"github.com/filecoin-project/go-fil-components/shared/tokenamount"
"github.com/filecoin-project/go-fil-components/shared/types"
tut "github.com/filecoin-project/go-fil-components/shared_testutil"
)

func TestClient_Query(t *testing.T) {
Expand Down
12 changes: 2 additions & 10 deletions retrievalmarket/impl/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ func (p *provider) ListDeals() map[retrievalmarket.ProviderDealID]retrievalmarke
panic("not implemented")
}

func writeErr(stream network.Stream, err error) {
log.Errorf("Retrieval deal error: %+v", err)
_ = cborutil.WriteCborRPC(stream, &OldDealResponse{
Status: Error,
Message: err.Error(),
})
}

// TODO: Update for https://github.com/filecoin-project/go-retrieval-market-project/issues/8
func (p *provider) HandleQueryStream(stream rmnet.RetrievalQueryStream) {
defer stream.Close()
Expand Down Expand Up @@ -156,15 +148,15 @@ func (p *provider) HandleQueryStream(stream rmnet.RetrievalQueryStream) {
}
}

type handlerDeal struct {
/* type handlerDeal struct {
p *provider
stream network.Stream
ufsr UnixfsReader
open cid.Cid
at uint64
size uint64
}
}*/

// TODO: Update for https://github.com/filecoin-project/go-retrieval-market-project/issues/7
func (p *provider) HandleDealStream(stream rmnet.RetrievalDealStream) {
Expand Down
9 changes: 5 additions & 4 deletions retrievalmarket/impl/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import (
"testing"

"github.com/filecoin-project/go-address"
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-fil-components/retrievalmarket"
retrievalimpl "github.com/filecoin-project/go-fil-components/retrievalmarket/impl"
"github.com/filecoin-project/go-fil-components/retrievalmarket/network"
tut "github.com/filecoin-project/go-fil-components/retrievalmarket/network/testutil"
"github.com/filecoin-project/go-fil-components/shared/tokenamount"
"github.com/filecoin-project/go-fil-components/shared/types"
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/stretchr/testify/require"
tut "github.com/filecoin-project/go-fil-components/shared_testutil"
)

func TestHandleQueryStream(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions retrievalmarket/network/libp2p_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ func (tr *testReceiver) HandleDealStream(s network.RetrievalDealStream) {
defer s.Close()
if tr.dealStreamHandler != nil {
tr.dealStreamHandler(s)
return
}
}
func (tr *testReceiver) HandleQueryStream(s network.RetrievalQueryStream) {
defer s.Close()
if tr.queryStreamHandler != nil {
tr.queryStreamHandler(s)
return
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package testutil
package shared_testutil

import (
"errors"
Expand Down

0 comments on commit bb5e2ac

Please sign in to comment.