From 2b847a98ae5a5c6dae1a67264494cd050bfe1a5e Mon Sep 17 00:00:00 2001 From: Aayush Date: Tue, 17 May 2022 18:33:15 -0400 Subject: [PATCH] fix wdpost_dispute tests --- build/bundle.go | 2 +- build/bundles.toml | 2 +- itests/wdpost_dispute_test.go | 10 ++++++---- node/bundle/manifest.go | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/bundle.go b/build/bundle.go index dc2faff24..c09aba8d8 100644 --- a/build/bundle.go +++ b/build/bundle.go @@ -37,7 +37,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 diff --git a/build/bundles.toml b/build/bundles.toml index 2cab2b155..2a2dcbb3b 100644 --- a/build/bundles.toml +++ b/build/bundles.toml @@ -1,3 +1,3 @@ [[bundles]] version = 8 -release = "dev/20220520" +release = "dev/20220524" \ No newline at end of file diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index bc307eb84..b1df48053 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -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)") } } diff --git a/node/bundle/manifest.go b/node/bundle/manifest.go index d726b0260..355bc358e 100644 --- a/node/bundle/manifest.go +++ b/node/bundle/manifest.go @@ -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)