mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-09 16:04:38 +01:00
Merge pull request #9587 from guggero/mining-block-limit-configurable
lntest: make mining block limit configurable
This commit is contained in:
commit
76808a81a0
1 changed files with 15 additions and 4 deletions
|
@ -59,6 +59,13 @@ const (
|
||||||
thawHeightDelta = finalCltvDelta * 2 // 36.
|
thawHeightDelta = finalCltvDelta * 2 // 36.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// MaxBlocksMinedPerTest is the maximum number of blocks that we allow
|
||||||
|
// a test to mine. This is an exported global variable so it can be
|
||||||
|
// overwritten by other projects that don't have the same constraints.
|
||||||
|
MaxBlocksMinedPerTest = 50
|
||||||
|
)
|
||||||
|
|
||||||
// TestCase defines a test case that's been used in the integration test.
|
// TestCase defines a test case that's been used in the integration test.
|
||||||
type TestCase struct {
|
type TestCase struct {
|
||||||
// Name specifies the test name.
|
// Name specifies the test name.
|
||||||
|
@ -396,10 +403,14 @@ func (h *HarnessTest) checkAndLimitBlocksMined(startHeight int32) {
|
||||||
"5. use `CreateSimpleNetwork` for efficient channel creation.\n"
|
"5. use `CreateSimpleNetwork` for efficient channel creation.\n"
|
||||||
h.Log(desc)
|
h.Log(desc)
|
||||||
|
|
||||||
// We enforce that the test should not mine more than 50 blocks, which
|
// We enforce that the test should not mine more than
|
||||||
// is more than enough to test a multi hop force close scenario.
|
// MaxBlocksMinedPerTest (50 by default) blocks, which is more than
|
||||||
require.LessOrEqual(h, int(blocksMined), 50, "cannot mine more than "+
|
// enough to test a multi hop force close scenario.
|
||||||
"50 blocks in one test")
|
require.LessOrEqualf(
|
||||||
|
h, int(blocksMined), MaxBlocksMinedPerTest,
|
||||||
|
"cannot mine more than %d blocks in one test",
|
||||||
|
MaxBlocksMinedPerTest,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// shutdownNodesNoAssert will shutdown all running nodes without assertions.
|
// shutdownNodesNoAssert will shutdown all running nodes without assertions.
|
||||||
|
|
Loading…
Add table
Reference in a new issue