avoid double close.

This commit is contained in:
Raúl Kripalani 2021-06-22 17:18:07 +01:00
parent 9b2efd5ace
commit 120dd14979

View File

@ -19,7 +19,6 @@ import (
"github.com/filecoin-project/lotus/api"
"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/types"
"github.com/filecoin-project/lotus/cli"
@ -35,12 +34,6 @@ const (
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
// node that is connected through a gateway to a full API node
func TestGatewayWalletMsig(t *testing.T) {
@ -49,7 +42,6 @@ func TestGatewayWalletMsig(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodes(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
defer nodes.closer()
lite := nodes.lite
full := nodes.full
@ -181,7 +173,6 @@ func TestGatewayMsigCLI(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
defer nodes.closer()
lite := nodes.lite
runMultisigTests(t, lite)
@ -193,7 +184,6 @@ func TestGatewayDealFlow(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
defer nodes.closer()
time.Sleep(5 * time.Second)
@ -216,16 +206,14 @@ func TestGatewayCLIDealFlow(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
defer nodes.closer()
kit.RunClientTest(t, cli.Commands, nodes.lite)
}
type testNodes struct {
lite *kit.TestFullNode
full *kit.TestFullNode
miner *kit.TestMiner
closer jsonrpc.ClientCloser
lite *kit.TestFullNode
full *kit.TestFullNode
miner *kit.TestMiner
}
func startNodesWithFunds(
@ -298,7 +286,7 @@ func startNodes(
),
).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 {