mock.go 661 Bytes
Newer Older
1
2
3
4
package sectorbuilder

import (
	"github.com/filecoin-project/go-address"
Łukasz Magiera's avatar
Łukasz Magiera committed
5
	"github.com/filecoin-project/go-sectorbuilder/fs"
6
7
8
	"github.com/ipfs/go-datastore"
)

Łukasz Magiera's avatar
Łukasz Magiera committed
9
10
func TempSectorbuilderDir(paths []fs.PathConfig, sectorSize uint64, ds datastore.Batching) (*SectorBuilder, error) {
	addr, err := address.NewFromString("t0123")
11
12
13
14
15
16
17
	if err != nil {
		return nil, err
	}

	sb, err := New(&Config{
		SectorSize: sectorSize,

Łukasz Magiera's avatar
Łukasz Magiera committed
18
		Paths: paths,
19
20
21
22
23
24
25
26
27
28

		WorkerThreads: 2,
		Miner:         addr,
	}, ds)
	if err != nil {
		return nil, err
	}

	return sb, nil
}
Łukasz Magiera's avatar
Łukasz Magiera committed
29
30
31
32

func SimplePath(dir string) []fs.PathConfig {
	return []fs.PathConfig{{
		Path:   dir,
33
		Cache:  true,
Łukasz Magiera's avatar
Łukasz Magiera committed
34
35
36
		Weight: 1,
	}}
}