remove duplicated vars.

This commit is contained in:
Raúl Kripalani 2021-05-19 17:30:06 +01:00
parent 88c6642330
commit 625b18771d
2 changed files with 8 additions and 13 deletions

View File

@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"math"
"os"
"testing"
"time"
@ -30,15 +29,11 @@ import (
"github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/api/v1api"
"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/node"
builder "github.com/filecoin-project/lotus/node/test"
)
const maxLookbackCap = time.Duration(math.MaxInt64)
const maxStateWaitLookbackLimit = stmgr.LookbackNoLimit
func init() {
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
@ -53,7 +48,7 @@ func TestWalletMsig(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodes(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
nodes := startNodes(ctx, t, blocktime, DefautLookbackCap, DefaultStateWaitLookbackLimit)
defer nodes.closer()
lite := nodes.lite
@ -187,7 +182,7 @@ func TestMsigCLI(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
nodes := startNodesWithFunds(ctx, t, blocktime, DefautLookbackCap, DefaultStateWaitLookbackLimit)
defer nodes.closer()
lite := nodes.lite
@ -200,7 +195,7 @@ func TestDealFlow(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
nodes := startNodesWithFunds(ctx, t, blocktime, DefautLookbackCap, DefaultStateWaitLookbackLimit)
defer nodes.closer()
// For these tests where the block time is artificially short, just use
@ -216,7 +211,7 @@ func TestCLIDealFlow(t *testing.T) {
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
nodes := startNodesWithFunds(ctx, t, blocktime, DefautLookbackCap, DefaultStateWaitLookbackLimit)
defer nodes.closer()
clitest.RunClientTest(t, cli.Commands, nodes.lite)

View File

@ -32,8 +32,8 @@ import (
var log = logging.Logger("gateway")
const (
LookbackCap = time.Hour * 24
StateWaitLookbackLimit = abi.ChainEpoch(20)
DefautLookbackCap = time.Hour * 24
DefaultStateWaitLookbackLimit = abi.ChainEpoch(20)
)
func main() {
@ -81,12 +81,12 @@ var runCmd = &cli.Command{
&cli.DurationFlag{
Name: "api-max-lookback",
Usage: "maximum duration allowable for tipset lookbacks",
Value: LookbackCap,
Value: DefautLookbackCap,
},
&cli.Int64Flag{
Name: "api-wait-lookback-limit",
Usage: "maximum number of blocks to search back through for message inclusion",
Value: int64(StateWaitLookbackLimit),
Value: int64(DefaultStateWaitLookbackLimit),
},
},
Action: func(cctx *cli.Context) error {