Fix tests after specs update

This commit is contained in:
Aayush Rajasekaran 2021-09-29 20:44:27 -04:00
parent 84b6734063
commit 8756df2447
2 changed files with 21 additions and 3 deletions

View File

@ -6,6 +6,8 @@ import (
"fmt"
"math/rand"
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
cbg "github.com/whyrusleeping/cbor-gen"
@ -399,11 +401,24 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
}
// Commit one-by-one, otherwise pledge math tends to explode
confirmParams := &builtin0.ConfirmSectorProofsParams{
Sectors: []abi.SectorNumber{preseal.SectorID},
var paramBytes []byte
if av >= actors.Version6 {
// TODO: fixup
confirmParams := &builtin6.ConfirmSectorProofsParams{
Sectors: []abi.SectorNumber{preseal.SectorID},
}
paramBytes = mustEnc(confirmParams)
} else {
confirmParams := &builtin0.ConfirmSectorProofsParams{
Sectors: []abi.SectorNumber{preseal.SectorID},
}
paramBytes = mustEnc(confirmParams)
}
_, err = doExecValue(ctx, vm, minerInfos[i].maddr, power.Address, big.Zero(), miner.Methods.ConfirmSectorProofsValid, mustEnc(confirmParams))
_, err = doExecValue(ctx, vm, minerInfos[i].maddr, power.Address, big.Zero(), miner.Methods.ConfirmSectorProofsValid, paramBytes)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to confirm presealed sectors: %w", err)
}

View File

@ -5,6 +5,8 @@ import (
"context"
"testing"
"github.com/filecoin-project/go-state-types/network"
market0 "github.com/filecoin-project/specs-actors/actors/builtin/market"
"github.com/golang/mock/gomock"
@ -59,6 +61,7 @@ func TestStateRecoverDealIDs(t *testing.T) {
}),
},
}, nil)
api.EXPECT().StateNetworkVersion(ctx, nil).Return(network.Version0, nil)
api.EXPECT().StateMarketStorageDeal(ctx, dealId, nil).Return(&api2.MarketDeal{
Proposal: dealProposal,
}, nil)