Magik shouldn't write code at midnight
This commit is contained in:
parent
2f0a9f6c40
commit
f00cf70df0
@ -123,10 +123,10 @@ var TwoFull = DefaultFullOpts(2)
|
|||||||
|
|
||||||
var FullNodeWithLatestActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
|
var FullNodeWithLatestActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
|
||||||
// Attention: Update this when introducing new actor versions or your tests will be sad
|
// 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{{
|
fullSchedule := stmgr.UpgradeSchedule{{
|
||||||
// prepare for upgrade.
|
// prepare for upgrade.
|
||||||
Network: network.Version9,
|
Network: network.Version9,
|
||||||
@ -158,9 +158,10 @@ var FullNodeWithActorsUpgradeAt = func(version network.Version, upgradeHeight ab
|
|||||||
if upgradeHeight > 0 {
|
if upgradeHeight > 0 {
|
||||||
schedule[len(schedule)-1].Height = upgradeHeight
|
schedule[len(schedule)-1].Height = upgradeHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
return FullNodeOpts{
|
return FullNodeOpts{
|
||||||
Opts: func(nodes []TestNode) node.Option {
|
Opts: func(nodes []TestNode) node.Option {
|
||||||
return node.Override(new(stmgr.UpgradeSchedule), fullSchedule)
|
return node.Override(new(stmgr.UpgradeSchedule), schedule)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,10 @@ package test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/filecoin-project/go-state-types/network"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
|
|
||||||
lapi "github.com/filecoin-project/lotus/api"
|
lapi "github.com/filecoin-project/lotus/api"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/actors"
|
"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) {
|
test := func(nv network.Version, shouldWork bool) func(*testing.T) {
|
||||||
return func(t *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)
|
api := nodes[0].FullNode.(*impl.FullNodeAPI)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@ -128,7 +129,7 @@ func AddVerifiedClient(t *testing.T, b APIBuilder) {
|
|||||||
t.Fatal("expected nil err", err)
|
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")
|
t.Fatal("Add datacap to an existing verified client should fail")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user