Get node_test to pass

This commit is contained in:
Łukasz Magiera 2020-03-05 23:27:30 +01:00
parent 1461e475da
commit 16cb27b5f9
4 changed files with 8 additions and 6 deletions

View File

@ -36,7 +36,7 @@ type StorageMinerAPI struct {
Miner *storage.Miner
BlockMiner *miner.Miner
Full api.FullNode
StorageMgr *advmgr.Manager `optional:"true"`
StorageMgr *advmgr.Manager `optional:"true"`
}
func (sm *StorageMinerAPI) ServeRemote(w http.ResponseWriter, r *http.Request) {

View File

@ -9,6 +9,7 @@ import (
"testing"
"time"
"github.com/filecoin-project/go-fil-markets/storedcounter"
"github.com/ipfs/go-datastore"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p-core/crypto"
@ -377,7 +378,7 @@ func mockSbBuilder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []t
storers[i] = testStorageNode(ctx, t, wa, genMiner, pk, f, mn, node.Options(
node.Override(new(sealmgr.Manager), func() (sealmgr.Manager, error) {
return sealmgr.NewSimpleManager(nil, genMiner, sbmock.NewMockSectorBuilder(5, build.SectorSizes[0]))
return sealmgr.NewSimpleManager(storedcounter.New(datastore.NewMapDatastore(), datastore.NewKey("/potato")), genMiner, sbmock.NewMockSectorBuilder(5, build.SectorSizes[0]))
}),
node.Unset(new(*advmgr.Manager)),
))

View File

@ -88,9 +88,6 @@ func (lmem *lockedMemRepo) Path() string {
}
}
lmem.tempDir = t
return t
}

View File

@ -32,8 +32,12 @@ type Simple struct {
worker Worker
}
type sszgetter interface {
SectorSize() abi.SectorSize
}
func (s *Simple) SectorSize() abi.SectorSize {
panic("implement me")
return s.worker.(sszgetter).SectorSize()
}
func NewSimpleManager(sc *storedcounter.StoredCounter, maddr address.Address, sb sectorbuilder.Basic) (*Simple, error) {