Skip to content

Commit 223762e

Browse files
committed
Fuzz test
1 parent c8a54d0 commit 223762e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

eclair-core/src/test/scala/fr/acinq/eclair/PackageSpec.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import fr.acinq.bitcoin.BitcoinError.ChainHashMismatch
2020
import fr.acinq.bitcoin.scalacompat.Crypto.PrivateKey
2121
import fr.acinq.bitcoin.scalacompat.{Block, ByteVector32, Crypto, Script, TxHash, TxId, addressToPublicKeyScript}
2222
import fr.acinq.bitcoin.{Base58, Base58Check, Bech32}
23+
import org.scalatest.Tag
2324
import org.scalatest.funsuite.AnyFunSuite
2425
import scodec.bits._
2526

@@ -114,14 +115,14 @@ class PackageSpec extends AnyFunSuite {
114115
assert(ShortChannelId(Long.MaxValue) < ShortChannelId(Long.MaxValue + 1))
115116
}
116117

117-
test("node fees") {
118+
test("node fees", Tag("fuzzy")) {
118119
val rng = new scala.util.Random()
119120
for (_ <- 1 to 100) {
120121
val amount = rng.nextLong(1_000_000_000_000L) msat
121122
val baseFee = rng.nextLong(10_000) msat
122123
val proportionalFee = rng.nextLong(5_000)
123124
val amountWithFees = amount + nodeFee(baseFee, proportionalFee, amount)
124-
assert(amountAfterFee(baseFee, proportionalFee, amountWithFees) == amount)
125+
assert(amountAfterFee(baseFee, proportionalFee, amountWithFees) == amount, s"amount=$amount baseFee=$baseFee proportionalFee=$proportionalFee")
125126
}
126127
}
127128

0 commit comments

Comments
 (0)