zold 0.31.2 → 0.31.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fea49da6a5daff42ee6e9d429a0f8a27b3b930ea5394d67bfd1ef11932bddaa
4
- data.tar.gz: be7c0b568ea2119d083b0cc6e0a2761166b20475cdf63a72d4e5cce02f24f791
3
+ metadata.gz: 346ea55d69f9f0410a3c64f23ec4dc1cf357799943b626cb2aad5047b2408d80
4
+ data.tar.gz: c5b9048c9288a72f06c65fb468c56f6e83705be574ed5293da76b466f82df681
5
5
  SHA512:
6
- metadata.gz: 3e44bbb2a8dad04e0407c3d2fc7d965cd5a574fed98ae6b8872ad1bc6c6f27dff2f7317f95a86f2c3151ddae32287e74da7a30cfb3e675a3ac36a9bad667d063
7
- data.tar.gz: b5081ec8bb0db18d78107d6dccd05e01450f126bc6582665d4bfd469cf0e73a32e9dd2983ed062d792f76c33ea68470d803342800b6c9b75bca777c3284c756c
6
+ metadata.gz: a9e869d86c20026e939bcb9853d11481ec1c2c1dcd2a3314fa3164daa730e46a5a8d1bcfcc6432e117935285c6f21f7b7c745a194bcc7af4434920b7f5523f48
7
+ data.tar.gz: c68c9eb1c103eb8606325a16ae6ffdf74a653bc9e968fc1f45fea01498cfd70f44b0152db3588720a2241e1bbd612d2befdf5bc6c3da96b7c8f7c05675b08b14
@@ -17,7 +17,6 @@ module Zold
17
17
  end
18
18
 
19
19
  def run(args = [])
20
- @log.debug("Alias.run(#{args.join(' ')})")
21
20
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
22
21
  o.banner = "Usage: zold alias [args]
23
22
  #{Rainbow('alias set <wallet> <alias>').green}
@@ -39,7 +39,6 @@ module Zold
39
39
  end
40
40
 
41
41
  def run(args = [])
42
- @log.debug("Calculate.run(#{args.join(' ')})")
43
42
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
44
43
  o.banner = "Usage: zold score [options]
45
44
  Available options:"
@@ -50,7 +50,6 @@ module Zold
50
50
  end
51
51
 
52
52
  def run(args = [])
53
- @log.debug("Clean.run(#{args.join(' ')})")
54
53
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
55
54
  o.banner = "Usage: zold clean [ID...] [options]
56
55
  Available options:"
@@ -44,7 +44,6 @@ module Zold
44
44
  end
45
45
 
46
46
  def run(args = [])
47
- @log.debug("Create.run(#{args.join(' ')})")
48
47
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
49
48
  o.banner = "Usage: zold create [options]
50
49
  Available options:"
@@ -46,7 +46,6 @@ module Zold
46
46
  end
47
47
 
48
48
  def run(args = [])
49
- @log.debug("Diff.run(#{args.join(' ')})")
50
49
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
51
50
  o.banner = "Usage: zold diff [ID...] [options]
52
51
  Available options:"
@@ -70,7 +70,6 @@ module Zold
70
70
  end
71
71
 
72
72
  def run(args = [])
73
- @log.debug("Fetch.run(#{args.join(' ')})")
74
73
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
75
74
  o.banner = "Usage: zold fetch [ID...] [options]
76
75
  Available options:"
@@ -44,7 +44,6 @@ module Zold
44
44
  end
45
45
 
46
46
  def run(args = [])
47
- @log.debug("Invoice.run(#{args.join(' ')})")
48
47
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
49
48
  o.banner = "Usage: zold invoice ID [options]
50
49
  Where:
@@ -51,7 +51,6 @@ module Zold
51
51
 
52
52
  # Returns the array of modified wallets (IDs)
53
53
  def run(args = [])
54
- @log.debug("Merge.run(#{args.join(' ')})")
55
54
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
56
55
  o.banner = "Usage: zold merge [ID...] [options]
57
56
  Available options:"
@@ -39,7 +39,6 @@ module Zold
39
39
  end
40
40
 
41
41
  def run(args = [])
42
- @log.debug("Next.run(#{args.join(' ')})")
43
42
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
44
43
  o.banner = "Usage: zold next [options] score
45
44
  Available options:"
@@ -73,7 +73,6 @@ module Zold
73
73
  end
74
74
 
75
75
  def run(args = [])
76
- @log.debug("Node.run(#{args.join(' ')})")
77
76
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
78
77
  o.banner = 'Usage: zold node [options]'
79
78
  o.string '--invoice',
@@ -48,7 +48,6 @@ module Zold
48
48
  # Sends a payment and returns the transaction just created in the
49
49
  # paying wallet, an instance of Zold::Txn
50
50
  def run(args = [])
51
- @log.debug("Pay.run(#{args.join(' ')})")
52
51
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
53
52
  o.banner = "Usage: zold pay wallet target amount [details] [options]
54
53
  Where:
@@ -82,6 +81,9 @@ Available options:"
82
81
  o.bool '--ignore-score-weakness',
83
82
  'Don\'t complain when their score is too weak (when paying taxes)',
84
83
  default: false
84
+ o.bool '--ignore-score-size',
85
+ 'Don\'t complain when their score is too small (when paying taxes)',
86
+ default: false
85
87
  o.bool '--dont-pay-taxes',
86
88
  'Don\'t pay taxes even if the wallet is in debt',
87
89
  default: false
@@ -141,8 +143,9 @@ Available options:"
141
143
  "--private-key=#{Shellwords.escape(opts['private-key'])}",
142
144
  opts['pay-taxes-anyway'] ? '--pay-anyway' : '',
143
145
  opts['ignore-score-weakness'] ? '--ignore-score-weakness' : '',
146
+ opts['ignore-score-size'] ? '--ignore-score-size' : '',
144
147
  id.to_s,
145
- "--keygap=#{Shellwords.escape(opts['keygap'])}"
148
+ opts['keygap'].empty? ? '' : "--keygap=#{Shellwords.escape(opts['keygap'])}"
146
149
  ].reject(&:empty?)
147
150
  )
148
151
  end
@@ -46,7 +46,6 @@ module Zold
46
46
 
47
47
  # Returns list of Wallet IDs which were affected
48
48
  def run(args = [])
49
- @log.debug("Propagate.run(#{args.join(' ')})")
50
49
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
51
50
  o.banner = "Usage: zold propagate [ID...] [options]
52
51
  Available options:"
@@ -59,7 +59,6 @@ module Zold
59
59
  end
60
60
 
61
61
  def run(args = [])
62
- @log.debug("Push.run(#{args.join(' ')})")
63
62
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
64
63
  o.banner = "Usage: zold push [ID...] [options]
65
64
  Available options:"
@@ -54,7 +54,6 @@ module Zold
54
54
  end
55
55
 
56
56
  def run(args = [])
57
- @log.debug("Remote.run(#{args.join(' ')})")
58
57
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
59
58
  o.banner = "Usage: zold remote <command> [options]
60
59
  Available commands:
@@ -41,7 +41,6 @@ module Zold
41
41
  end
42
42
 
43
43
  def run(args = [])
44
- @log.debug("Remove.run(#{args.join(' ')})")
45
44
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
46
45
  o.banner = "Usage: zold remove [ID...] [options]
47
46
  Available options:"
@@ -48,7 +48,6 @@ module Zold
48
48
  end
49
49
 
50
50
  def run(args = [])
51
- @log.debug("Show.run(#{args.join(' ')})")
52
51
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
53
52
  o.banner = "Usage: zold show [ID...] [options]
54
53
  Available options:"
@@ -61,7 +61,6 @@ module Zold
61
61
  end
62
62
 
63
63
  def run(args = [])
64
- @log.debug("Taxes.run(#{args.join(' ')})")
65
64
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
66
65
  o.banner = "Usage: zold taxes command [options]
67
66
  Available commands:
@@ -82,6 +81,9 @@ Available options:"
82
81
  o.bool '--ignore-score-weakness',
83
82
  'Don\'t complain when their score is too weak',
84
83
  default: false
84
+ o.bool '--ignore-score-size',
85
+ 'Don\'t complain when their score is too small',
86
+ default: false
85
87
  o.string '--keygap',
86
88
  'Keygap, if the private RSA key is not complete',
87
89
  default: ''
@@ -191,12 +193,8 @@ the balance is #{wallet.balance}: #{tax.to_text}")
191
193
  json = JsonPage.new(res.body, uri).to_hash
192
194
  score = Score.parse_json(json['score'])
193
195
  r.assert_valid_score(score)
194
- if opts['ignore-score-weakness']
195
- @log.debug('We ignore score weakeness...')
196
- else
197
- r.assert_score_strength(score)
198
- end
199
- r.assert_score_value(score, Tax::EXACT_SCORE)
196
+ r.assert_score_strength(score) unless opts['ignore-score-weakness']
197
+ r.assert_score_value(score, Tax::EXACT_SCORE) unless opts['ignore-score-size']
200
198
  @log.info("#{r}: #{Rainbow(score.value).green} to #{score.invoice}")
201
199
  best << score
202
200
  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.2'
28
+ VERSION = '0.31.4'
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.2
4
+ version: 0.31.4
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.2!
826
+ Thanks for installing Zold 0.31.4!
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