lib/zold/commands/taxes.rb in zold-0.8 vs lib/zold/commands/taxes.rb in zold-0.9
- old
+ new
@@ -85,11 +85,11 @@
def pay(wallet, _)
raise 'The wallet is absent' unless wallet.exists?
tax = Tax.new(wallet)
debt = tax.debt
@log.debug("The current debt is #{debt} (#{debt.to_i} zents)")
- if debt <= Tax::TRIAL
+ unless debt.in_debt?
@log.debug("No need to pay taxes yet, until the debt is less than #{Tax::TRIAL} (#{Tax::TRIAL.to_i} zents)")
return
end
top = top_scores
while debt > Amount::ZERO
@@ -142,11 +142,11 @@
end
if score.strength < Score::STRENGTH
@log.info("#{name} score #{Rainbow(score.value).red} is too weak (<#{Score::STRENGTH})")
next
end
- if score.value < Tax::MIN_SCORE
- @log.info("#{name} score #{Rainbow(score.value).red} is too small (<#{Tax::MIN_SCORE})")
+ if score.value < Tax::EXACT_SCORE
+ @log.info("#{name} score #{Rainbow(score.value).red} is too small (<#{Tax::EXACT_SCORE})")
next
end
@log.info("#{score.host}:#{score.port}: #{Rainbow(score.value).green}")
best << score
end