Skip to content

Commit 7afb77d

Browse files
author
LexLuthr
committedDec 19, 2023
cleanup itest fixtures, fix gql
1 parent 28a31a1 commit 7afb77d

File tree

4 files changed

+7
-193
lines changed

4 files changed

+7
-193
lines changed
 

‎gql/module.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ import (
2727
"go.uber.org/fx"
2828
)
2929

30-
func NewGraphqlServer(cfg *config.Boost) func(lc fx.Lifecycle, r repo.LockedRepo, h host.Host, prov *storagemarket.Provider, dealsDB *db.DealsDB, logsDB *db.LogsDB, retDB *rtvllog.RetrievalLogDB, plDB *db.ProposalLogsDB, fundsDB *db.FundsDB, fundMgr *fundmanager.FundManager, storageMgr *storagemanager.StorageManager, publisher *storageadapter.DealPublisher, spApi sealingpipeline.API, legacyDeals legacy.LegacyDealManager, piecedirectory *piecedirectory.PieceDirectory, indexProv provider.Interface, idxProvWrapper *indexprovider.Wrapper, fullNode v1api.FullNode, bg BlockGetter, ssm *sectorstatemgr.SectorStateMgr, mpool *mpoolmonitor.MpoolMonitor, mma *lib.MultiMinerAccessor, sask storedask.StoredAsk) *Server {
31-
return func(lc fx.Lifecycle, r repo.LockedRepo, h host.Host, prov *storagemarket.Provider, dealsDB *db.DealsDB, logsDB *db.LogsDB, retDB *rtvllog.RetrievalLogDB, plDB *db.ProposalLogsDB, fundsDB *db.FundsDB, fundMgr *fundmanager.FundManager,
30+
func NewGraphqlServer(cfg *config.Boost) func(lc fx.Lifecycle, r repo.LockedRepo, h host.Host, prov *storagemarket.Provider, ddProv *storagemarket.DirectDealsProvider, dealsDB *db.DealsDB, directDealsDB *db.DirectDealsDB, logsDB *db.LogsDB, retDB *rtvllog.RetrievalLogDB, plDB *db.ProposalLogsDB, fundsDB *db.FundsDB, fundMgr *fundmanager.FundManager, storageMgr *storagemanager.StorageManager, publisher *storageadapter.DealPublisher, spApi sealingpipeline.API, legacyDeals legacy.LegacyDealManager, piecedirectory *piecedirectory.PieceDirectory, indexProv provider.Interface, idxProvWrapper *indexprovider.Wrapper, fullNode v1api.FullNode, bg BlockGetter, ssm *sectorstatemgr.SectorStateMgr, mpool *mpoolmonitor.MpoolMonitor, mma *lib.MultiMinerAccessor, sask storedask.StoredAsk) *Server {
31+
return func(lc fx.Lifecycle, r repo.LockedRepo, h host.Host, prov *storagemarket.Provider, ddProv *storagemarket.DirectDealsProvider, dealsDB *db.DealsDB, directDealsDB *db.DirectDealsDB, logsDB *db.LogsDB, retDB *rtvllog.RetrievalLogDB, plDB *db.ProposalLogsDB, fundsDB *db.FundsDB, fundMgr *fundmanager.FundManager,
3232
storageMgr *storagemanager.StorageManager, publisher *storageadapter.DealPublisher, spApi sealingpipeline.API,
3333
legacyDeals legacy.LegacyDealManager, piecedirectory *piecedirectory.PieceDirectory,
3434
indexProv provider.Interface, idxProvWrapper *indexprovider.Wrapper, fullNode v1api.FullNode, bg BlockGetter,
3535
ssm *sectorstatemgr.SectorStateMgr, mpool *mpoolmonitor.MpoolMonitor, mma *lib.MultiMinerAccessor, sask storedask.StoredAsk) *Server {
3636

3737
resolverCtx, cancel := context.WithCancel(context.Background())
38-
resolver := NewResolver(resolverCtx, cfg, r, h, dealsDB, logsDB, retDB, plDB, fundsDB, fundMgr, storageMgr, spApi, prov, legacyDeals, piecedirectory, publisher, indexProv, idxProvWrapper, fullNode, ssm, mpool, mma, sask)
38+
resolver := NewResolver(resolverCtx, cfg, r, h, dealsDB, directDealsDB, logsDB, retDB, plDB, fundsDB, fundMgr, storageMgr, spApi, prov, ddProv, legacyDeals, piecedirectory, publisher, indexProv, idxProvWrapper, fullNode, ssm, mpool, mma, sask)
3939
svr := NewServer(cfg, resolver, bg)
4040

4141
lc.Append(fx.Hook{

‎itests/data_segment_index_retrieval_test.go

+3-25
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/google/uuid"
1414
"github.com/ipfs/go-cid"
1515
carv2 "github.com/ipld/go-car/v2"
16+
trustlessutils "github.com/ipld/go-trustless-utils"
1617
"github.com/stretchr/testify/require"
1718
)
1819

@@ -39,21 +40,6 @@ func TestDataSegmentIndexRetrieval(t *testing.T) {
3940
err = f.AddClientProviderBalance(abi.NewTokenAmount(1e15))
4041
require.NoError(t, err)
4142

42-
//// Create a CAR file
43-
//tempdir := t.TempDir()
44-
//log.Debugw("using tempdir", "dir", tempdir)
45-
//
46-
//// Select the number of car segments to use in test
47-
//seg := 2
48-
//
49-
//// Generate car file containing multiple car files
50-
//segmentDetails, err := framework.GenerateDataSegmentFiles(t, tempdir, seg)
51-
//require.NoError(t, err)
52-
//
53-
//p := segmentDetails.Piece.PieceCID.String()
54-
//
55-
//log.Info(p)
56-
5743
// Start a web server to serve the car files
5844
log.Debug("starting webserver")
5945
server, err := testutil.HttpTestFileServer(t, "fixtures")
@@ -78,27 +64,19 @@ func TestDataSegmentIndexRetrieval(t *testing.T) {
7864
err = f.WaitForDealAddedToSector(dealUuid)
7965
require.NoError(t, err)
8066

81-
////Retrieve and compare the all car files within the deal
82-
//for i := 0; i < seg; i++ {
83-
// for _, r := range segmentDetails.Segments[i].Root {
84-
// outFile := f.RetrieveDirect(ctx, t, r, &res.DealParams.ClientDealProposal.Proposal.PieceCID, true)
85-
// kit.AssertFilesEqual(t, segmentDetails.Segments[i].FilePath, outFile)
86-
// }
87-
//}
88-
8967
r1, err := cid.Parse("bafykbzaceaqliwrg6y2bxrhhbbiz3nknhz43yj2bqog4rulu5km5qhkckffuw")
9068
require.NoError(t, err)
9169
r2, err := cid.Parse("bafykbzaceccq64xf6yadlbmqpfindtf5x3cssel2fozkhvdyrrtnjnutr5j52")
9270
require.NoError(t, err)
9371

94-
outF1 := f.RetrieveDirect(ctx, t, r1, &pieceCid, false, nil)
72+
outF1 := f.Retrieve(ctx, t, trustlessutils.Request{Root: r1, Scope: trustlessutils.DagScopeAll}, false)
9573
r, err := carv2.OpenReader(outF1)
9674
require.NoError(t, err)
9775
rs, err := r.Roots()
9876
require.NoError(t, err)
9977
require.Equal(t, r1, rs[0])
10078
r.Close()
101-
outf2 := f.RetrieveDirect(ctx, t, r2, &pieceCid, false, nil)
79+
outf2 := f.Retrieve(ctx, t, trustlessutils.Request{Root: r2, Scope: trustlessutils.DagScopeAll}, false)
10280
r, err = carv2.OpenReader(outf2)
10381
require.NoError(t, err)
10482
rs, err = r.Roots()

‎itests/framework/fixtures.go

-164
This file was deleted.

0 commit comments

Comments
 (0)