fix up some tests

This commit is contained in:
Jeromy 2020-04-17 13:44:13 -07:00
parent e6270e4291
commit 24b7661837
7 changed files with 35 additions and 14 deletions

View File

@ -358,9 +358,13 @@ func (cg *ChainGen) NextTipSetFromMiners(base *types.TipSet, miners []address.Ad
}
if et != nil {
// TODO: winning post proof
_ = ticket
fblk, err := cg.makeBlock(base, m, ticket, et, bvals, round, msgs)
// TODO: maybe think about passing in more real parameters to this?
wpost, err := cg.eppProvs[m].ComputeProof(context.TODO(), nil, nil)
if err != nil {
return nil, err
}
fblk, err := cg.makeBlock(base, m, ticket, et, bvals, round, wpost, msgs)
if err != nil {
return nil, xerrors.Errorf("making a block for next tipset failed: %w", err)
}
@ -384,7 +388,7 @@ func (cg *ChainGen) NextTipSetFromMiners(base *types.TipSet, miners []address.Ad
func (cg *ChainGen) makeBlock(parents *types.TipSet, m address.Address, vrfticket *types.Ticket,
eticket *types.ElectionProof, bvals []types.BeaconEntry, height abi.ChainEpoch,
msgs []*types.SignedMessage) (*types.FullBlock, error) {
wpost []abi.PoStProof, msgs []*types.SignedMessage) (*types.FullBlock, error) {
var ts uint64
if cg.Timestamper != nil {
@ -394,14 +398,15 @@ func (cg *ChainGen) makeBlock(parents *types.TipSet, m address.Address, vrfticke
}
fblk, err := MinerCreateBlock(context.TODO(), cg.sm, cg.w, &api.BlockTemplate{
Miner: m,
Parents: parents.Key(),
Ticket: vrfticket,
Eproof: eticket,
BeaconValues: bvals,
Messages: msgs,
Epoch: height,
Timestamp: ts,
Miner: m,
Parents: parents.Key(),
Ticket: vrfticket,
Eproof: eticket,
BeaconValues: bvals,
Messages: msgs,
Epoch: height,
Timestamp: ts,
WinningPoStProof: wpost,
})
if err != nil {
return nil, err

View File

@ -1,6 +1,7 @@
package messagepool
import (
"context"
"fmt"
"testing"
@ -74,6 +75,13 @@ func (tma *testMpoolApi) StateGetActor(addr address.Address, ts *types.TipSet) (
}, nil
}
func (tma *testMpoolApi) StateAccountKey(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) {
if addr.Protocol() != address.BLS && addr.Protocol() != address.SECP256K1 {
return address.Undef, fmt.Errorf("given address was not a key addr")
}
return addr, nil
}
func (tma *testMpoolApi) MessagesForBlock(h *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) {
return nil, tma.bmsgs[h.Cid()], nil
}

View File

@ -1,5 +1,6 @@
package validation
/*
import (
"context"
@ -171,3 +172,4 @@ func toLotusSignedMsg(msg *vtypes.SignedMessage) *types.SignedMessage {
Signature: msg.Signature,
}
}
*/

View File

@ -1,5 +1,6 @@
package validation
/*
import (
"context"
@ -45,3 +46,4 @@ func (f *Factories) NewValidationConfig() vstate.ValidationConfig {
checkState := true
return NewConfig(trackGas, checkExit, checkRet, checkState)
}
*/

View File

@ -1,5 +1,6 @@
package validation
/*
import (
"context"
@ -203,3 +204,4 @@ type contextStore struct {
func (s *contextStore) Context() context.Context {
return s.ctx
}
*/

View File

@ -1,5 +1,6 @@
package vm_test
/*
import (
"fmt"
"reflect"
@ -33,7 +34,7 @@ var TestSuiteSkipper TestSkipper
func init() {
// initialize the test skipper with tests being skipped
TestSuiteSkipper = TestSkipper{testSkips: []suites.TestCase{
/* tests to skip go here */
// tests to skip go here
}}
}
@ -66,3 +67,4 @@ func caseName(testCase suites.TestCase) string {
toks := strings.Split(fqName, ".")
return toks[len(toks)-1]
}
*/

View File

@ -399,7 +399,7 @@ var sealBenchCmd = &cli.Command{
if !c.Bool("skip-commit2") {
log.Info("generating winning post candidates")
fcandidates, err := sb.GenerateWinningPoStSectorChallenge(context.TODO(), spt, mid, challenge[:], uint64(len(sealedSectors)))
fcandidates, err := ffiwrapper.ProofVerifier.GenerateWinningPoStSectorChallenge(context.TODO(), spt, mid, challenge[:], uint64(len(sealedSectors)))
if err != nil {
return err
}