zold 0.23.8 → 0.23.9
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/commands/remote.rb +5 -4
- data/lib/zold/version.rb +1 -1
- data/test/commands/test_remote.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6adc05e3a39654916c6db0930e0cc0e2040c911ae82224e43e8fd08f534977ef
|
|
4
|
+
data.tar.gz: 5426a3ef89226b32836cbe793949d05e352af6f33e0dbfc09dc0618a72cb71ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97154e00aef0b0a65f1d13a72f2577c8aec2e0d820c852f0c855b008c0e51512cffa962ab9634dc80e0661d8b6cc57d28e35ae94c89f046ea2b61d2de91256c5
|
|
7
|
+
data.tar.gz: 77d6c919564d1412e65bfe7344006408e08d3994457c9ab6fb37c02284073146f16cfa099ca6f7274dfb12ee26b052df237d80f59e42ebafba17232f9091f9f7
|
data/lib/zold/commands/remote.rb
CHANGED
|
@@ -345,12 +345,13 @@ it's recommended to reboot, but I don't do it because of --never-reboot")
|
|
|
345
345
|
end
|
|
346
346
|
|
|
347
347
|
def select(opts)
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
@remotes.all.sort_by { |r| r[:score] }.reverse.each_with_index do |r, idx|
|
|
349
|
+
next if idx < opts['max-nodes']
|
|
350
|
+
next if r[:master] && !opts['masters-too']
|
|
351
|
+
@remotes.remove(r[:host], r[:port])
|
|
351
352
|
@log.info("Remote #{r[:host]}:#{r[:port]}/#{r[:score]} removed from the list, #{@remotes.all.count} left")
|
|
352
353
|
end
|
|
353
|
-
@log.info("#{
|
|
354
|
+
@log.info("#{@remotes.all.count} remote nodes left in the list")
|
|
354
355
|
end
|
|
355
356
|
|
|
356
357
|
def terminate
|
data/lib/zold/version.rb
CHANGED
|
@@ -231,6 +231,16 @@ class TestRemote < Zold::Test
|
|
|
231
231
|
end
|
|
232
232
|
end
|
|
233
233
|
|
|
234
|
+
def test_select_doesnt_touch_masters
|
|
235
|
+
Dir.mktmpdir do |dir|
|
|
236
|
+
remotes = Zold::Remotes.new(file: File.join(dir, 'remotes.txt'))
|
|
237
|
+
cmd = Zold::Remote.new(remotes: remotes, log: test_log)
|
|
238
|
+
cmd.run(%w[remote masters])
|
|
239
|
+
cmd.run(%w[remote select --max-nodes=0])
|
|
240
|
+
assert(!remotes.all.empty?)
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
|
|
234
244
|
def test_updates_just_once
|
|
235
245
|
Dir.mktmpdir do |dir|
|
|
236
246
|
remotes = Zold::Remotes.new(file: File.join(dir, 'a/b/c/remotes'))
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zold
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.23.
|
|
4
|
+
version: 0.23.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-02-
|
|
11
|
+
date: 2019-02-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: backtrace
|
|
@@ -753,7 +753,7 @@ licenses:
|
|
|
753
753
|
- MIT
|
|
754
754
|
metadata: {}
|
|
755
755
|
post_install_message: |-
|
|
756
|
-
Thanks for installing Zold 0.23.
|
|
756
|
+
Thanks for installing Zold 0.23.9!
|
|
757
757
|
Study our White Paper: https://papers.zold.io/wp.pdf
|
|
758
758
|
Read our blog posts: https://blog.zold.io
|
|
759
759
|
Try ZLD online wallet at: https://wts.zold.io
|