Fix tests

This commit is contained in:
Aayush Rajasekaran 2020-09-07 02:08:53 -04:00
parent be7fb9d3df
commit d678fe4bfa
24 changed files with 56 additions and 28 deletions

View File

@ -2,9 +2,10 @@ package api
import (
"context"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"time"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"

View File

@ -4,11 +4,12 @@ import (
"bytes"
"context"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"io/ioutil"
"sync/atomic"
"time"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"

View File

@ -4,13 +4,14 @@ import (
"bytes"
"context"
"fmt"
saruntime "github.com/filecoin-project/specs-actors/actors/runtime"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"os"
"reflect"
"runtime"
"strings"
saruntime "github.com/filecoin-project/specs-actors/actors/runtime"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
cid "github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
cbg "github.com/whyrusleeping/cbor-gen"

View File

@ -5,13 +5,14 @@ import (
"context"
"errors"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"os"
"sort"
"strconv"
"strings"
"time"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/Gurpartap/async"
"github.com/hashicorp/go-multierror"
"github.com/ipfs/go-cid"

View File

@ -3,11 +3,12 @@ package chain_test
import (
"context"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"os"
"testing"
"time"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"

View File

@ -2,9 +2,10 @@ package types
import (
"bytes"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"math/big"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/minio/blake2b-simd"
"github.com/filecoin-project/go-state-types/abi"

View File

@ -7,6 +7,8 @@ import (
"reflect"
"testing"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
cid "github.com/ipfs/go-cid"
"github.com/stretchr/testify/require"

View File

@ -6,6 +6,8 @@ import (
"math/rand"
"os"
"github.com/filecoin-project/specs-actors/actors/builtin/power"
"github.com/filecoin-project/go-address"
"golang.org/x/xerrors"

View File

@ -2,6 +2,7 @@ package vm
import (
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/go-address"

View File

@ -2,6 +2,7 @@ package vm
import (
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/go-state-types/abi"

View File

@ -4,10 +4,11 @@ import (
"bytes"
"context"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
goruntime "runtime"
"sync"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/go-address"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"

View File

@ -5,7 +5,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime"
"html/template"
"io"
"os"
@ -15,6 +14,8 @@ import (
"strings"
"time"
"github.com/filecoin-project/specs-actors/actors/runtime"
"github.com/multiformats/go-multiaddr"
"github.com/ipfs/go-cid"

View File

@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"io/ioutil"
"math/big"
"math/rand"
@ -12,6 +11,8 @@ import (
"path/filepath"
"time"
saproof "github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/docker/go-units"
logging "github.com/ipfs/go-log/v2"
"github.com/minio/blake2b-simd"
@ -236,7 +237,7 @@ var sealBenchCmd = &cli.Command{
}
var sealTimings []SealingResult
var sealedSectors []proof.SectorInfo
var sealedSectors []saproof.SectorInfo
if robench == "" {
var err error
@ -279,7 +280,7 @@ var sealBenchCmd = &cli.Command{
}
for _, s := range genm.Sectors {
sealedSectors = append(sealedSectors, proof.SectorInfo{
sealedSectors = append(sealedSectors, saproof.SectorInfo{
SealedCID: s.CommR,
SectorNumber: s.SectorID,
SealProof: s.ProofType,
@ -304,7 +305,7 @@ var sealBenchCmd = &cli.Command{
return err
}
candidates := make([]proof.SectorInfo, len(fcandidates))
candidates := make([]saproof.SectorInfo, len(fcandidates))
for i, fcandidate := range fcandidates {
candidates[i] = sealedSectors[fcandidate]
}
@ -327,7 +328,7 @@ var sealBenchCmd = &cli.Command{
winnningpost2 := time.Now()
pvi1 := abi.WinningPoStVerifyInfo{
pvi1 := saproof.WinningPoStVerifyInfo{
Randomness: abi.PoStRandomness(challenge[:]),
Proofs: proof1,
ChallengedSectors: candidates,
@ -343,7 +344,7 @@ var sealBenchCmd = &cli.Command{
verifyWinningPost1 := time.Now()
pvi2 := abi.WinningPoStVerifyInfo{
pvi2 := saproof.WinningPoStVerifyInfo{
Randomness: abi.PoStRandomness(challenge[:]),
Proofs: proof2,
ChallengedSectors: candidates,
@ -375,7 +376,7 @@ var sealBenchCmd = &cli.Command{
windowpost2 := time.Now()
wpvi1 := proof.WindowPoStVerifyInfo{
wpvi1 := saproof.WindowPoStVerifyInfo{
Randomness: challenge[:],
Proofs: wproof1,
ChallengedSectors: sealedSectors,
@ -391,7 +392,7 @@ var sealBenchCmd = &cli.Command{
verifyWindowpost1 := time.Now()
wpvi2 := proof.WindowPoStVerifyInfo{
wpvi2 := saproof.WindowPoStVerifyInfo{
Randomness: challenge[:],
Proofs: wproof2,
ChallengedSectors: sealedSectors,
@ -463,10 +464,10 @@ type ParCfg struct {
Commit int
}
func runSeals(sb *ffiwrapper.Sealer, sbfs *basicfs.Provider, numSectors int, par ParCfg, mid abi.ActorID, sectorSize abi.SectorSize, ticketPreimage []byte, saveC2inp string, skipc2, skipunseal bool) ([]SealingResult, []proof.SectorInfo, error) {
func runSeals(sb *ffiwrapper.Sealer, sbfs *basicfs.Provider, numSectors int, par ParCfg, mid abi.ActorID, sectorSize abi.SectorSize, ticketPreimage []byte, saveC2inp string, skipc2, skipunseal bool) ([]SealingResult, []saproof.SectorInfo, error) {
var pieces []abi.PieceInfo
sealTimings := make([]SealingResult, numSectors)
sealedSectors := make([]proof.SectorInfo, numSectors)
sealedSectors := make([]saproof.SectorInfo, numSectors)
preCommit2Sema := make(chan struct{}, par.PreCommit2)
commitSema := make(chan struct{}, par.Commit)
@ -536,7 +537,7 @@ func runSeals(sb *ffiwrapper.Sealer, sbfs *basicfs.Provider, numSectors int, par
precommit2 := time.Now()
<-preCommit2Sema
sealedSectors[ix] = proof.SectorInfo{
sealedSectors[ix] = saproof.SectorInfo{
SealProof: sb.SealProofType(),
SectorNumber: i,
SealedCID: cids.Sealed,
@ -588,7 +589,7 @@ func runSeals(sb *ffiwrapper.Sealer, sbfs *basicfs.Provider, numSectors int, par
<-commitSema
if !skipc2 {
svi := proof.SealVerifyInfo{
svi := saproof.SealVerifyInfo{
SectorID: abi.SectorID{Miner: mid, Number: i},
SealedCID: cids.Sealed,
SealProof: sb.SealProofType(),

View File

@ -4,6 +4,8 @@ import (
"encoding/hex"
"fmt"
saproof "github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/urfave/cli/v2"
ffi "github.com/filecoin-project/filecoin-ffi"
@ -82,7 +84,7 @@ var verifySealProofCmd = &cli.Command{
snum := abi.SectorNumber(cctx.Uint64("sector-id"))
ok, err := ffi.VerifySeal(proof.SealVerifyInfo{
ok, err := ffi.VerifySeal(saproof.SealVerifyInfo{
SectorID: abi.SectorID{
Miner: abi.ActorID(mid),
Number: snum,

View File

@ -2,6 +2,7 @@ package conformance
import (
"context"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/go-address"

View File

@ -15,6 +15,8 @@ import (
"testing"
"time"
saproof "github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
@ -91,7 +93,7 @@ func (s *seal) commit(t *testing.T, sb *Sealer, done func()) {
t.Fatalf("%+v", err)
}
ok, err := ProofVerifier.VerifySeal(proof.SealVerifyInfo{
ok, err := ProofVerifier.VerifySeal(saproof.SealVerifyInfo{
SectorID: s.id,
SealedCID: s.cids.Sealed,
SealProof: sealProofType,

View File

@ -2,9 +2,10 @@ package ffiwrapper
import (
"context"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"io"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"

View File

@ -4,6 +4,7 @@ package ffiwrapper
import (
"context"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"golang.org/x/xerrors"

View File

@ -5,11 +5,12 @@ import (
"context"
"crypto/sha256"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"io"
"math/rand"
"sync"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
commcid "github.com/filecoin-project/go-fil-commcid"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-storage/storage"

View File

@ -3,6 +3,7 @@ package sealing
import (
"bytes"
"context"
saproof "github.com/filecoin-project/specs-actors/actors/runtime/proof"
"golang.org/x/xerrors"

View File

@ -6,10 +6,11 @@ import (
"crypto/rand"
"encoding/binary"
"fmt"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"sync"
"time"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/lotus/chain/gen/slashfilter"
"github.com/filecoin-project/go-address"

View File

@ -3,6 +3,7 @@ package storage
import (
"bytes"
"context"
"github.com/filecoin-project/go-bitfield"
"github.com/ipfs/go-cid"

View File

@ -3,9 +3,10 @@ package storage
import (
"context"
"errors"
"time"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"time"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"

View File

@ -4,9 +4,10 @@ import (
"bytes"
"context"
"errors"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"time"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-address"