1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-23 06:35:11 +01:00

fixup! Harden requirements on htlc-minimum-msat (#1339) (#1363)

Update fuzzy tests to not use zero-value amounts.
This commit is contained in:
Pierre-Marie Padiou 2020-04-02 15:40:00 +02:00 committed by GitHub
parent 7b58d3e831
commit 0e260985e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -440,7 +440,7 @@ class CommitmentsSpec extends TestkitBaseClass with StateTestsHelperMethods {
var c = CommitmentsSpec.makeCommitments(t.toLocal, t.toRemote, t.feeRatePerKw, t.dustLimit, t.isFunder)
// Add some initial HTLCs to the pending list (bigger commit tx).
for (_ <- 0 to t.pendingHtlcs) {
val amount = Random.nextInt(maxPendingHtlcAmount.toLong.toInt).msat
val amount = Random.nextInt(maxPendingHtlcAmount.toLong.toInt).msat.max(1 msat)
val (_, cmdAdd) = makeCmdAdd(amount, randomKey.publicKey, f.currentBlockHeight)
sendAdd(c, cmdAdd, Local(UUID.randomUUID, None), f.currentBlockHeight) match {
case Success((cc, _)) => c = cc
@ -468,7 +468,7 @@ class CommitmentsSpec extends TestkitBaseClass with StateTestsHelperMethods {
var c = CommitmentsSpec.makeCommitments(t.toLocal, t.toRemote, t.feeRatePerKw, t.dustLimit, t.isFunder)
// Add some initial HTLCs to the pending list (bigger commit tx).
for (_ <- 0 to t.pendingHtlcs) {
val amount = Random.nextInt(maxPendingHtlcAmount.toLong.toInt).msat
val amount = Random.nextInt(maxPendingHtlcAmount.toLong.toInt).msat.max(1 msat)
val add = UpdateAddHtlc(randomBytes32, c.remoteNextHtlcId, amount, randomBytes32, CltvExpiry(f.currentBlockHeight), TestConstants.emptyOnionPacket)
receiveAdd(c, add) match {
case Success(cc) => c = cc