fix test
This commit is contained in:
parent
fcf69e7b82
commit
2c9ea8c46b
@ -59,6 +59,13 @@ import (
|
||||
testing2 "github.com/filecoin-project/lotus/node/modules/testing"
|
||||
"github.com/filecoin-project/lotus/node/repo"
|
||||
"github.com/filecoin-project/lotus/storage/mockstorage"
|
||||
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
|
||||
power3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/power"
|
||||
"github.com/ipfs/go-datastore"
|
||||
libp2pcrypto "github.com/libp2p/go-libp2p-core/crypto"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -408,16 +415,19 @@ func (n *Ensemble) Start() *Ensemble {
|
||||
|
||||
// we get the proof type for the requested sector size, for
|
||||
// the current network version.
|
||||
nv, err := m.FullNode.FullNode.StateNetworkVersion(ctx, types.EmptyTSK)
|
||||
require.NoError(n.t, err)
|
||||
// nv, err := m.FullNode.FullNode.StateNetworkVersion(ctx, types.EmptyTSK)
|
||||
// require.NoError(n.t, err)
|
||||
|
||||
proofType, err := miner.SealProofTypeFromSectorSize(m.options.sectorSize, nv)
|
||||
require.NoError(n.t, err)
|
||||
// this doesn't currently work with the FVM -- we need to specify policy somehow
|
||||
// proofType, err := miner.WindowPoStProofTypeFromSectorSize(m.options.sectorSize)
|
||||
// require.NoError(n.t, err)
|
||||
// so do this instead, which works:
|
||||
proofType := abi.RegisteredPoStProof_StackedDrgWindow64GiBV1
|
||||
|
||||
params, aerr := actors.SerializeParams(&power2.CreateMinerParams{
|
||||
params, aerr := actors.SerializeParams(&power3.CreateMinerParams{
|
||||
Owner: m.OwnerKey.Address,
|
||||
Worker: m.OwnerKey.Address,
|
||||
SealProofType: proofType,
|
||||
WindowPoStProofType: proofType,
|
||||
Peer: abi.PeerID(m.Libp2p.PeerID),
|
||||
})
|
||||
require.NoError(n.t, aerr)
|
||||
@ -437,7 +447,7 @@ func (n *Ensemble) Start() *Ensemble {
|
||||
require.NoError(n.t, err)
|
||||
require.Equal(n.t, exitcode.Ok, mw.Receipt.ExitCode)
|
||||
|
||||
var retval power2.CreateMinerReturn
|
||||
var retval power3.CreateMinerReturn
|
||||
err = retval.UnmarshalCBOR(bytes.NewReader(mw.Receipt.Return))
|
||||
require.NoError(n.t, err, "failed to create miner")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user