avoid double close.
This commit is contained in:
parent
9b2efd5ace
commit
120dd14979
@ -19,7 +19,6 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/api/client"
|
"github.com/filecoin-project/lotus/api/client"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
|
||||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/filecoin-project/lotus/cli"
|
"github.com/filecoin-project/lotus/cli"
|
||||||
@ -35,12 +34,6 @@ const (
|
|||||||
maxStateWaitLookbackLimit = stmgr.LookbackNoLimit
|
maxStateWaitLookbackLimit = stmgr.LookbackNoLimit
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
|
|
||||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
|
||||||
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
|
||||||
}
|
|
||||||
|
|
||||||
// TestGatewayWalletMsig tests that API calls to wallet and msig can be made on a lite
|
// TestGatewayWalletMsig tests that API calls to wallet and msig can be made on a lite
|
||||||
// node that is connected through a gateway to a full API node
|
// node that is connected through a gateway to a full API node
|
||||||
func TestGatewayWalletMsig(t *testing.T) {
|
func TestGatewayWalletMsig(t *testing.T) {
|
||||||
@ -49,7 +42,6 @@ func TestGatewayWalletMsig(t *testing.T) {
|
|||||||
blocktime := 5 * time.Millisecond
|
blocktime := 5 * time.Millisecond
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
nodes := startNodes(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
nodes := startNodes(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
||||||
defer nodes.closer()
|
|
||||||
|
|
||||||
lite := nodes.lite
|
lite := nodes.lite
|
||||||
full := nodes.full
|
full := nodes.full
|
||||||
@ -181,7 +173,6 @@ func TestGatewayMsigCLI(t *testing.T) {
|
|||||||
blocktime := 5 * time.Millisecond
|
blocktime := 5 * time.Millisecond
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
||||||
defer nodes.closer()
|
|
||||||
|
|
||||||
lite := nodes.lite
|
lite := nodes.lite
|
||||||
runMultisigTests(t, lite)
|
runMultisigTests(t, lite)
|
||||||
@ -193,7 +184,6 @@ func TestGatewayDealFlow(t *testing.T) {
|
|||||||
blocktime := 5 * time.Millisecond
|
blocktime := 5 * time.Millisecond
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
||||||
defer nodes.closer()
|
|
||||||
|
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
|
|
||||||
@ -216,16 +206,14 @@ func TestGatewayCLIDealFlow(t *testing.T) {
|
|||||||
blocktime := 5 * time.Millisecond
|
blocktime := 5 * time.Millisecond
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
|
||||||
defer nodes.closer()
|
|
||||||
|
|
||||||
kit.RunClientTest(t, cli.Commands, nodes.lite)
|
kit.RunClientTest(t, cli.Commands, nodes.lite)
|
||||||
}
|
}
|
||||||
|
|
||||||
type testNodes struct {
|
type testNodes struct {
|
||||||
lite *kit.TestFullNode
|
lite *kit.TestFullNode
|
||||||
full *kit.TestFullNode
|
full *kit.TestFullNode
|
||||||
miner *kit.TestMiner
|
miner *kit.TestMiner
|
||||||
closer jsonrpc.ClientCloser
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func startNodesWithFunds(
|
func startNodesWithFunds(
|
||||||
@ -298,7 +286,7 @@ func startNodes(
|
|||||||
),
|
),
|
||||||
).Start().InterconnectAll()
|
).Start().InterconnectAll()
|
||||||
|
|
||||||
return &testNodes{lite: &lite, full: full, miner: miner, closer: closer}
|
return &testNodes{lite: &lite, full: full, miner: miner}
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendFunds(ctx context.Context, fromNode *kit.TestFullNode, fromAddr address.Address, toAddr address.Address, amt types.BigInt) error {
|
func sendFunds(ctx context.Context, fromNode *kit.TestFullNode, fromAddr address.Address, toAddr address.Address, amt types.BigInt) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user