mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-04 02:54:00 +01:00
Don't allow fee unit gen to be 0 (#2346)
* Don't allow fee unit gen to be 0 * Fix other 0 * Fix always 0 fee unit gen
This commit is contained in:
parent
b7ffea2525
commit
61d3a14c07
1 changed files with 2 additions and 2 deletions
|
@ -42,7 +42,7 @@ abstract class FeeUnitGen {
|
||||||
*/
|
*/
|
||||||
private def lowFee: Gen[Satoshis] = {
|
private def lowFee: Gen[Satoshis] = {
|
||||||
Gen
|
Gen
|
||||||
.choose(0, 100)
|
.choose(1, 100)
|
||||||
.map(Satoshis(_))
|
.map(Satoshis(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ abstract class FeeUnitGen {
|
||||||
|
|
||||||
/** Generates a FeeUnit based on the maxFee allowed for a transaction */
|
/** Generates a FeeUnit based on the maxFee allowed for a transaction */
|
||||||
def feeUnit(maxFee: Long): Gen[FeeUnit] = {
|
def feeUnit(maxFee: Long): Gen[FeeUnit] = {
|
||||||
Gen.choose(0L, maxFee / 10000L).map { n =>
|
Gen.choose(1L, maxFee).map { n =>
|
||||||
SatoshisPerKiloByte(Satoshis(n))
|
SatoshisPerKiloByte(Satoshis(n))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue