From f00cf70df078d594dfa6b0f8024490f003add1fc Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 1 Jun 2021 17:11:54 -0400 Subject: [PATCH] Magik shouldn't write code at midnight --- api/test/test.go | 7 ++++--- api/test/verifreg.go | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/api/test/test.go b/api/test/test.go index 11f0f41ea..7609d0702 100644 --- a/api/test/test.go +++ b/api/test/test.go @@ -123,10 +123,10 @@ var TwoFull = DefaultFullOpts(2) var FullNodeWithLatestActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts { // Attention: Update this when introducing new actor versions or your tests will be sad - return FullNodeWithActorsUpgradeAt(network.Version13, upgradeHeight) + return FullNodeWithNetworkUpgradeAt(network.Version13, upgradeHeight) } -var FullNodeWithActorsUpgradeAt = func(version network.Version, upgradeHeight abi.ChainEpoch) FullNodeOpts { +var FullNodeWithNetworkUpgradeAt = func(version network.Version, upgradeHeight abi.ChainEpoch) FullNodeOpts { fullSchedule := stmgr.UpgradeSchedule{{ // prepare for upgrade. Network: network.Version9, @@ -158,9 +158,10 @@ var FullNodeWithActorsUpgradeAt = func(version network.Version, upgradeHeight ab if upgradeHeight > 0 { schedule[len(schedule)-1].Height = upgradeHeight } + return FullNodeOpts{ Opts: func(nodes []TestNode) node.Option { - return node.Override(new(stmgr.UpgradeSchedule), fullSchedule) + return node.Override(new(stmgr.UpgradeSchedule), schedule) }, } } diff --git a/api/test/verifreg.go b/api/test/verifreg.go index 266bed190..3fc1fb75a 100644 --- a/api/test/verifreg.go +++ b/api/test/verifreg.go @@ -2,9 +2,10 @@ package test import ( "context" - "github.com/filecoin-project/go-state-types/network" "strings" + "github.com/filecoin-project/go-state-types/network" + lapi "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors" @@ -23,7 +24,7 @@ func AddVerifiedClient(t *testing.T, b APIBuilder) { test := func(nv network.Version, shouldWork bool) func(*testing.T) { return func(t *testing.T) { - nodes, miners := b(t, []FullNodeOpts{FullNodeWithActorsUpgradeAt(nv, -1)}, OneMiner) + nodes, miners := b(t, []FullNodeOpts{FullNodeWithNetworkUpgradeAt(nv, -1)}, OneMiner) api := nodes[0].FullNode.(*impl.FullNodeAPI) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -128,7 +129,7 @@ func AddVerifiedClient(t *testing.T, b APIBuilder) { t.Fatal("expected nil err", err) } - if !shouldWork && err == nil || !strings.Contains(err.Error(), "verified client already exists") { + if !shouldWork && (err == nil || !strings.Contains(err.Error(), "verified client already exists")) { t.Fatal("Add datacap to an existing verified client should fail") } }