zold 0.31.1 → 0.31.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6c2e0650ee2719c29b2be5d2a89e2d8df6a5fe5eec198ded0b2a2406bc7c0d0
4
- data.tar.gz: f2759aa84462712e1351288c315b9c13021beb5c0c9eb69e5a78f9974e1b7a5e
3
+ metadata.gz: f86367b55fc3eb30911e64f63c88c58e086dbe3dceebe73c277e3b17230f06cd
4
+ data.tar.gz: a98f1f7e5587d25ae2f6b50efaf01bed6986c69f6a5b8b426efb28e1dac7fb5b
5
5
  SHA512:
6
- metadata.gz: 9109e7e7cd1afe84a2dcddcf74ff24a6489049fd99c75d556e8ec58f75fe4556775e5ca860f2ae58a40e6bfa1df71d5850781d385709d40466a045af7329bc82
7
- data.tar.gz: bcd96058d3dc22767340e39862cd6e5d0aa5100ab666ef68bac48fbea937b44a2561ca773c7a88dfa88ac3177231a7a7eb29736338184a0ff8e49dfe9dad3355
6
+ metadata.gz: 0d7d873e69e4c7b604a0a377c8cf86653e3801e42dcae5037c0d70279b07692e3577508cb5f4943ea49c9363c3f248a85310b8bb38625427bb23f91a42d97549
7
+ data.tar.gz: 2eb0da768f4acc1b4ccb8ba3bb79f2e105853a38e87a6dbc38f6c716ca4d47ca5417c1fe9e439d3ac4371c239ff7b160e22a99ade47f469da8c1baa6eb7bf45b
@@ -82,6 +82,9 @@ Available options:"
82
82
  o.bool '--ignore-score-weakness',
83
83
  'Don\'t complain when their score is too weak (when paying taxes)',
84
84
  default: false
85
+ o.bool '--ignore-score-size',
86
+ 'Don\'t complain when their score is too small (when paying taxes)',
87
+ default: false
85
88
  o.bool '--dont-pay-taxes',
86
89
  'Don\'t pay taxes even if the wallet is in debt',
87
90
  default: false
@@ -141,6 +144,7 @@ Available options:"
141
144
  "--private-key=#{Shellwords.escape(opts['private-key'])}",
142
145
  opts['pay-taxes-anyway'] ? '--pay-anyway' : '',
143
146
  opts['ignore-score-weakness'] ? '--ignore-score-weakness' : '',
147
+ opts['ignore-score-size'] ? '--ignore-score-size' : '',
144
148
  id.to_s,
145
149
  "--keygap=#{Shellwords.escape(opts['keygap'])}"
146
150
  ].reject(&:empty?)
@@ -82,6 +82,9 @@ Available options:"
82
82
  o.bool '--ignore-score-weakness',
83
83
  'Don\'t complain when their score is too weak',
84
84
  default: false
85
+ o.bool '--ignore-score-size',
86
+ 'Don\'t complain when their score is too small',
87
+ default: false
85
88
  o.string '--keygap',
86
89
  'Keygap, if the private RSA key is not complete',
87
90
  default: ''
@@ -184,6 +187,7 @@ the balance is #{wallet.balance}: #{tax.to_text}")
184
187
  def top_scores(opts)
185
188
  best = []
186
189
  @remotes.iterate(@log) do |r|
190
+ @log.debug("Testing #{r}...")
187
191
  uri = '/'
188
192
  res = r.http(uri).get
189
193
  r.assert_code(200, res)
@@ -191,7 +195,7 @@ the balance is #{wallet.balance}: #{tax.to_text}")
191
195
  score = Score.parse_json(json['score'])
192
196
  r.assert_valid_score(score)
193
197
  r.assert_score_strength(score) unless opts['ignore-score-weakness']
194
- r.assert_score_value(score, Tax::EXACT_SCORE)
198
+ r.assert_score_value(score, Tax::EXACT_SCORE) unless opts['ignore-score-size']
195
199
  @log.info("#{r}: #{Rainbow(score.value).green} to #{score.invoice}")
196
200
  best << score
197
201
  end
data/lib/zold/remotes.rb CHANGED
@@ -99,11 +99,14 @@ at #{response.headers['X-Zold-Path']}"
99
99
 
100
100
  def assert_score_strength(score)
101
101
  return if score.strength >= Score::STRENGTH
102
- raise CantAssert, "Score #{score.strength} is too weak (<#{Score::STRENGTH}): #{score.reduced(4)}"
102
+ raise CantAssert, "Score #{score.strength} is too weak (<#{Score::STRENGTH}): #{score.reduced(4)}
103
+ (use --ignore-score-strength to suppress this check)"
103
104
  end
104
105
 
105
106
  def assert_score_value(score, min)
106
- raise CantAssert, "Score #{score.value} is too small (<#{min}): #{score.reduced(4)}" if score.value < min
107
+ return if score.value >= min
108
+ raise CantAssert, "Score #{score.value} is too small (<#{min}): #{score.reduced(4)}
109
+ (use --ignore-score-size to suppress this check)"
107
110
  end
108
111
  end
109
112
 
data/lib/zold/version.rb CHANGED
@@ -25,7 +25,7 @@
25
25
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Zold
28
- VERSION = '0.31.1'
28
+ VERSION = '0.31.3'
29
29
  PROTOCOL = 2
30
30
  REPO = 'zold-io/zold'
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.1
4
+ version: 0.31.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -823,7 +823,7 @@ licenses:
823
823
  - MIT
824
824
  metadata: {}
825
825
  post_install_message: |-
826
- Thanks for installing Zold 0.31.1!
826
+ Thanks for installing Zold 0.31.3!
827
827
  Study our White Paper: https://papers.zold.io/wp.pdf
828
828
  Read our blog posts: https://blog.zold.io
829
829
  Try ZLD online wallet at: https://wts.zold.io