Skip to content

Commit

Permalink
remove duplicated vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed May 19, 2021
1 parent 88c6642 commit 625b187
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 4 additions & 9 deletions cmd/lotus-gateway/endtoend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"math"
"os"
"testing"
"time"
Expand All @@ -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))
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions cmd/lotus-gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 625b187

Please sign in to comment.