fix wdpost_dispute tests

This commit is contained in:
Aayush 2022-05-17 18:33:15 -04:00
parent c07c87c131
commit 2b847a98ae
4 changed files with 11 additions and 9 deletions

View File

@ -37,7 +37,7 @@ type Bundle struct {
Release string Release string
// Path is the (optional) bundle path; takes precedence over url // Path is the (optional) bundle path; takes precedence over url
Path map[string]string Path map[string]string
// URL is the (optional) bundle URL; takes precdence over github release // URL is the (optional) bundle URL; takes precedence over github release
URL map[string]BundleURL URL map[string]BundleURL
// Devlopment indicates whether this is a development version; when set, in conjunction with path, // Devlopment indicates whether this is a development version; when set, in conjunction with path,
// it will always load the bundle to the blockstore, without recording the manifest CID in the // it will always load the bundle to the blockstore, without recording the manifest CID in the

View File

@ -1,3 +1,3 @@
[[bundles]] [[bundles]]
version = 8 version = 8
release = "dev/20220520" release = "dev/20220524"

View File

@ -6,13 +6,13 @@ import (
"testing" "testing"
"time" "time"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
prooftypes "github.com/filecoin-project/go-state-types/proof" prooftypes "github.com/filecoin-project/go-state-types/proof"
"github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/builtin"
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner" minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api"
@ -226,7 +226,8 @@ func TestWindowPostDispute(t *testing.T) {
// Now try to be evil again // Now try to be evil again
err = submitBadProof(ctx, client, evilMiner.OwnerKey.Address, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition) err = submitBadProof(ctx, client, evilMiner.OwnerKey.Address, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
require.Error(t, err) require.Error(t, err)
require.Equal(t, 16, err) require.Contains(t, err.Error(), "invalid post was submitted")
require.Contains(t, err.Error(), "(RetCode=16)")
// It didn't work because we're recovering. // It didn't work because we're recovering.
} }
@ -330,7 +331,8 @@ waitForProof:
} }
_, err := client.MpoolPushMessage(ctx, msg, nil) _, err := client.MpoolPushMessage(ctx, msg, nil)
require.Error(t, err) require.Error(t, err)
require.Equal(t, err, 16) require.Contains(t, err.Error(), "failed to dispute valid post")
require.Contains(t, err.Error(), "(RetCode=16)")
} }
} }

View File

@ -49,17 +49,17 @@ func FetchAndLoadBundleFromURL(ctx context.Context, basePath string, bs blocksto
func LoadBundle(ctx context.Context, bs blockstore.Blockstore, path string, av actors.Version) (cid.Cid, error) { func LoadBundle(ctx context.Context, bs blockstore.Blockstore, path string, av actors.Version) (cid.Cid, error) {
f, err := os.Open(path) f, err := os.Open(path)
if err != nil { if err != nil {
return cid.Undef, xerrors.Errorf("error opening bundle for builtin-actors vresion %d: %w", av, err) return cid.Undef, xerrors.Errorf("error opening bundle for builtin-actors version %d: %w", av, err)
} }
defer f.Close() //nolint defer f.Close() //nolint
data, err := io.ReadAll(f) data, err := io.ReadAll(f)
if err != nil { if err != nil {
return cid.Undef, xerrors.Errorf("error reading bundle for builtin-actors vresion %d: %w", av, err) return cid.Undef, xerrors.Errorf("error reading bundle for builtin-actors version %d: %w", av, err)
} }
if err := actors.LoadBundle(ctx, bs, av, data); err != nil { if err := actors.LoadBundle(ctx, bs, av, data); err != nil {
return cid.Undef, xerrors.Errorf("error loading bundle for builtin-actors vresion %d: %w", av, err) return cid.Undef, xerrors.Errorf("error loading bundle for builtin-actors version %d: %w", av, err)
} }
mfCid, ok := actors.GetManifest(av) mfCid, ok := actors.GetManifest(av)