Merge pull request #8668 from filecoin-project/asr/fix-post-test

fix wdpost_dispute tests
This commit is contained in:
Aayush Rajasekaran 2022-05-24 14:22:01 -04:00 committed by GitHub
commit c2f0bd3c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View File

@ -20,7 +20,7 @@ type Bundle struct {
Release string
// Path is the (optional) bundle path; takes precedence over url
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
// 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

View File

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

View File

@ -6,13 +6,13 @@ import (
"testing"
"time"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
prooftypes "github.com/filecoin-project/go-state-types/proof"
"github.com/filecoin-project/go-state-types/builtin"
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/dline"
"github.com/filecoin-project/lotus/api"
@ -226,7 +226,8 @@ func TestWindowPostDispute(t *testing.T) {
// Now try to be evil again
err = submitBadProof(ctx, client, evilMiner.OwnerKey.Address, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
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.
}
@ -330,7 +331,8 @@ waitForProof:
}
_, err := client.MpoolPushMessage(ctx, msg, nil)
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) {
f, err := os.Open(path)
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
data, err := io.ReadAll(f)
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 {
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)