zold 0.14.20 → 0.14.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zold/tax.rb +4 -3
- data/lib/zold/version.rb +1 -1
- data/lib/zold/wallet.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a178783c0061e8ea31d65d43de478c40d7c128db
|
4
|
+
data.tar.gz: 9ee344f9c6edf0b74445432ec368537582396d6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859e4812c38e52e6c25e6f59ebe637f4fd17df734a2ca33698401c6e813bf90e93e476504f5c982e32ae3636e7588416acd1b2c8ee3d1299534d7ddf66c8b158
|
7
|
+
data.tar.gz: 440f5e22bb4b7d5e5011ca8dd40aaf3beb179ff24798e606e29275c6f204cd4a17b59d248334acfef4e176befa1a6dac24d4b0befc31e19d09f7196d7c43e070
|
data/lib/zold/tax.rb
CHANGED
@@ -77,15 +77,16 @@ module Zold
|
|
77
77
|
|
78
78
|
def debt
|
79
79
|
txns = @wallet.txns
|
80
|
-
|
80
|
+
scored = txns.map do |t|
|
81
81
|
pfx, body = t.details.split(' ', 2)
|
82
82
|
next if pfx != Tax::PREFIX || body.nil?
|
83
83
|
score = Score.parse_text(body)
|
84
84
|
next if !score.valid? || score.value != Tax::EXACT_SCORE
|
85
|
+
next if score.strength < Score::STRENGTH
|
85
86
|
next if t.amount > Tax::MAX_PAYMENT
|
86
87
|
score
|
87
|
-
end.reject(&:nil?).uniq(&:
|
88
|
-
paid =
|
88
|
+
end.reject(&:nil?).uniq(&:sign)
|
89
|
+
paid = scored.empty? ? Amount::ZERO : scored.map(&:amount).inject(&:+) * -1
|
89
90
|
owned = Tax::FEE_TXN_HOUR * txns.count * @wallet.age
|
90
91
|
owned - paid
|
91
92
|
end
|
data/lib/zold/version.rb
CHANGED
data/lib/zold/wallet.rb
CHANGED
@@ -117,7 +117,7 @@ module Zold
|
|
117
117
|
details
|
118
118
|
)
|
119
119
|
txn = txn.signed(pvt, id)
|
120
|
-
raise 'This is not the private
|
120
|
+
raise 'This is not the right private key for this wallet' unless Signature.new.valid?(key, id, txn)
|
121
121
|
add(txn)
|
122
122
|
txn
|
123
123
|
end
|