forked from irinazheltisheva/powergate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathldevnet.go
More file actions
34 lines (27 loc) · 711 Bytes
/
ldevnet.go
File metadata and controls
34 lines (27 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package tests
import (
"context"
"testing"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/build"
"github.com/textileio/fil-tools/ldevnet"
)
func init() {
build.InsecurePoStValidation = true
}
func CreateLocalDevnet(t *testing.T, numMiners int) (*ldevnet.LocalDevnet, address.Address, []address.Address, func()) {
dnet, err := ldevnet.New(numMiners, ldevnet.DefaultDuration)
if err != nil {
t.Fatal(err)
}
ctx := context.Background()
addr, err := dnet.Client.WalletDefaultAddress(ctx)
if err != nil {
t.Fatal(err)
}
miners, err := dnet.Client.StateListMiners(ctx, nil)
if err != nil {
t.Fatal(err)
}
return dnet, addr, miners, func() { dnet.Close() }
}