zold 0.16.24 → 0.16.25
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/.rultor.yml +1 -0
- data/.travis.yml +1 -0
- data/README.md +1 -1
- data/bin/zold +121 -117
- data/lib/zold/cached_wallets.rb +2 -2
- data/lib/zold/commands/create.rb +1 -1
- data/lib/zold/commands/diff.rb +1 -1
- data/lib/zold/commands/fetch.rb +3 -2
- data/lib/zold/commands/invoice.rb +2 -2
- data/lib/zold/commands/list.rb +9 -1
- data/lib/zold/commands/merge.rb +1 -1
- data/lib/zold/commands/pay.rb +2 -2
- data/lib/zold/commands/propagate.rb +3 -3
- data/lib/zold/commands/push.rb +3 -3
- data/lib/zold/commands/remote.rb +3 -3
- data/lib/zold/commands/remove.rb +1 -1
- data/lib/zold/commands/show.rb +1 -1
- data/lib/zold/commands/taxes.rb +3 -3
- data/lib/zold/http.rb +22 -19
- data/lib/zold/hungry_wallets.rb +2 -2
- data/lib/zold/node/entrance.rb +1 -1
- data/lib/zold/node/front.rb +3 -6
- data/lib/zold/node/nodup_entrance.rb +1 -1
- data/lib/zold/node/sync_entrance.rb +1 -1
- data/lib/zold/patch.rb +3 -5
- data/lib/zold/remotes.rb +7 -6
- data/lib/zold/sync_wallets.rb +3 -2
- data/lib/zold/tree_wallets.rb +2 -1
- data/lib/zold/version.rb +1 -1
- data/lib/zold/wallets.rb +2 -1
- data/test/commands/test_create.rb +1 -1
- data/test/commands/test_invoice.rb +1 -1
- data/test/commands/test_list.rb +1 -1
- data/test/commands/test_pull.rb +1 -1
- data/test/commands/test_show.rb +1 -1
- data/test/fake_home.rb +1 -1
- data/test/node/fake_node.rb +2 -2
- data/test/node/test_front.rb +30 -30
- data/test/test__helper.rb +1 -0
- data/test/test_cached_wallets.rb +2 -2
- data/test/test_http.rb +9 -9
- data/test/test_sync_wallets.rb +2 -2
- data/test/test_tree_wallets.rb +2 -2
- data/test/test_wallets.rb +2 -2
- data/test/upgrades/test_protocol_up.rb +1 -1
- data/zold.gemspec +7 -0
- metadata +36 -3
data/test/test__helper.rb
CHANGED
data/test/test_cached_wallets.rb
CHANGED
@@ -40,12 +40,12 @@ class TestCachedWallets < Zold::Test
|
|
40
40
|
wallets = Zold::CachedWallets.new(home.wallets)
|
41
41
|
id = Zold::Id.new
|
42
42
|
first = nil
|
43
|
-
wallets.
|
43
|
+
wallets.acq(id, exclusive: true) do |wallet|
|
44
44
|
wallet.init(id, Zold::Key.new(file: 'fixtures/id_rsa.pub'))
|
45
45
|
assert_equal(1, wallets.all.count)
|
46
46
|
first = wallet
|
47
47
|
end
|
48
|
-
wallets.
|
48
|
+
wallets.acq(id) do |wallet|
|
49
49
|
assert_equal(first, wallet)
|
50
50
|
end
|
51
51
|
end
|
data/test/test_http.rb
CHANGED
@@ -38,22 +38,22 @@ class TestHttp < Zold::Test
|
|
38
38
|
def test_pings_broken_uri
|
39
39
|
stub_request(:get, 'http://bad-host/').to_return(status: 500)
|
40
40
|
res = Zold::Http.new(uri: 'http://bad-host/').get
|
41
|
-
assert_equal(
|
41
|
+
assert_equal(500, res.status)
|
42
42
|
assert_equal('', res.body)
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_pings_with_exception
|
46
46
|
stub_request(:get, 'http://exception/').to_return { raise 'Intentionally' }
|
47
47
|
res = Zold::Http.new(uri: 'http://exception/').get
|
48
|
-
assert_equal(
|
48
|
+
assert_equal(599, res.status)
|
49
49
|
assert(res.body.include?('Intentionally'))
|
50
|
-
assert(!res.
|
50
|
+
assert(!res.headers['nothing'])
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_pings_live_uri
|
54
54
|
stub_request(:get, 'http://good-host/').to_return(status: 200)
|
55
55
|
res = Zold::Http.new(uri: 'http://good-host/').get
|
56
|
-
assert_equal(
|
56
|
+
assert_equal(200, res.status)
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_sends_valid_network_header
|
@@ -61,7 +61,7 @@ class TestHttp < Zold::Test
|
|
61
61
|
.with(headers: { 'X-Zold-Network' => 'xyz' })
|
62
62
|
.to_return(status: 200)
|
63
63
|
res = Zold::Http.new(uri: 'http://some-host-1/', network: 'xyz').get
|
64
|
-
assert_equal(
|
64
|
+
assert_equal(200, res.status)
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_sends_valid_protocol_header
|
@@ -69,7 +69,7 @@ class TestHttp < Zold::Test
|
|
69
69
|
.with(headers: { 'X-Zold-Protocol' => Zold::PROTOCOL })
|
70
70
|
.to_return(status: 200)
|
71
71
|
res = Zold::Http.new(uri: 'http://some-host-2/').get
|
72
|
-
assert_equal(
|
72
|
+
assert_equal(200, res.status)
|
73
73
|
end
|
74
74
|
|
75
75
|
def test_doesnt_terminate_on_long_call
|
@@ -87,7 +87,7 @@ class TestHttp < Zold::Test
|
|
87
87
|
end
|
88
88
|
sleep 0.25
|
89
89
|
res = Zold::Http.new(uri: "http://127.0.0.1:#{port}/").get(timeout: 2)
|
90
|
-
assert_equal(
|
90
|
+
assert_equal(200, res.status, res)
|
91
91
|
thread.kill
|
92
92
|
thread.join
|
93
93
|
end
|
@@ -105,7 +105,7 @@ class TestHttp < Zold::Test
|
|
105
105
|
end
|
106
106
|
sleep 0.25
|
107
107
|
res = Zold::Http.new(uri: "http://127.0.0.1:#{port}/").get(timeout: 0.1)
|
108
|
-
assert_equal(
|
108
|
+
assert_equal(599, res.status, res)
|
109
109
|
thread.kill
|
110
110
|
thread.join
|
111
111
|
end
|
@@ -116,6 +116,6 @@ class TestHttp < Zold::Test
|
|
116
116
|
.with(headers: { 'X-Zold-Version' => Zold::VERSION })
|
117
117
|
.to_return(status: 200)
|
118
118
|
res = Zold::Http.new(uri: 'http://some-host-3/').get
|
119
|
-
assert_equal(
|
119
|
+
assert_equal(200, res.status, res)
|
120
120
|
end
|
121
121
|
end
|
data/test/test_sync_wallets.rb
CHANGED
@@ -44,13 +44,13 @@ class TestSyncWallets < Zold::Test
|
|
44
44
|
key = Zold::Key.new(file: 'fixtures/id_rsa')
|
45
45
|
amount = Zold::Amount.new(zld: 5.0)
|
46
46
|
Threads.new(5).assert(100) do
|
47
|
-
wallets.
|
47
|
+
wallets.acq(id, exclusive: true) do |wallet|
|
48
48
|
wallet.sub(amount, "NOPREFIX@#{Zold::Id.new}", key)
|
49
49
|
wallet.refurbish
|
50
50
|
end
|
51
51
|
end
|
52
52
|
# assert_equal_wait(amount * -100, max: 4) do
|
53
|
-
# wallets.
|
53
|
+
# wallets.acq(id, &:balance)
|
54
54
|
# end
|
55
55
|
end
|
56
56
|
end
|
data/test/test_tree_wallets.rb
CHANGED
@@ -36,7 +36,7 @@ class TestTreeWallets < Zold::Test
|
|
36
36
|
Dir.mktmpdir do |dir|
|
37
37
|
wallets = Zold::TreeWallets.new(dir)
|
38
38
|
id = Zold::Id.new('abcd0123abcd0123')
|
39
|
-
wallets.
|
39
|
+
wallets.acq(id, exclusive: true) do |wallet|
|
40
40
|
wallet.init(id, Zold::Key.new(file: 'fixtures/id_rsa.pub'))
|
41
41
|
assert(wallet.path.end_with?('/a/b/c/d/abcd0123abcd0123.z'), wallet.path)
|
42
42
|
end
|
@@ -50,7 +50,7 @@ class TestTreeWallets < Zold::Test
|
|
50
50
|
wallets = Zold::TreeWallets.new(dir)
|
51
51
|
10.times do
|
52
52
|
id = Zold::Id.new
|
53
|
-
wallets.
|
53
|
+
wallets.acq(id, exclusive: true) do |wallet|
|
54
54
|
wallet.init(id, Zold::Key.new(file: 'fixtures/id_rsa.pub'))
|
55
55
|
end
|
56
56
|
end
|
data/test/test_wallets.rb
CHANGED
@@ -38,7 +38,7 @@ class TestWallets < Zold::Test
|
|
38
38
|
FakeHome.new(log: test_log).run do |home|
|
39
39
|
wallets = home.wallets
|
40
40
|
id = Zold::Id.new
|
41
|
-
wallets.
|
41
|
+
wallets.acq(id) do |wallet|
|
42
42
|
wallet.init(id, Zold::Key.new(file: 'fixtures/id_rsa.pub'))
|
43
43
|
assert_equal(1, wallets.all.count)
|
44
44
|
end
|
@@ -52,7 +52,7 @@ class TestWallets < Zold::Test
|
|
52
52
|
FileUtils.mkdir_p(File.join(home.dir, 'a/b/c'))
|
53
53
|
FileUtils.touch(File.join(home.dir, 'a/b/c/0000111122223333.z'))
|
54
54
|
id = Zold::Id.new
|
55
|
-
wallets.
|
55
|
+
wallets.acq(id) do |wallet|
|
56
56
|
wallet.init(id, Zold::Key.new(file: 'fixtures/id_rsa.pub'))
|
57
57
|
assert_equal(1, wallets.all.count)
|
58
58
|
end
|
@@ -34,7 +34,7 @@ class TestProtocolUp < Zold::Test
|
|
34
34
|
FakeHome.new(log: test_log).run do |home|
|
35
35
|
id = home.create_wallet.id
|
36
36
|
Zold::ProtocolUp.new(home.dir, test_log).exec
|
37
|
-
home.wallets.
|
37
|
+
home.wallets.acq(id) do |wallet|
|
38
38
|
assert_equal(Zold::PROTOCOL, wallet.protocol)
|
39
39
|
end
|
40
40
|
end
|
data/zold.gemspec
CHANGED
@@ -49,6 +49,11 @@ and suggests a different architecture for digital wallet maintenance.'
|
|
49
49
|
s.authors = ['Yegor Bugayenko']
|
50
50
|
s.email = 'yegor256@gmail.com'
|
51
51
|
s.homepage = 'http://github.com/zold-io/zold'
|
52
|
+
s.post_install_message = "Thanks for installing Zold #{Zold::VERSION}!
|
53
|
+
Study our White Paper: https://papers.zold.io/wp.pdf
|
54
|
+
Read our blog posts: https://blog.zold.io
|
55
|
+
Stay in touch with the dev community: https://t.me/zold_io
|
56
|
+
Follow us on Twitter: https://twitter.com/0crat"
|
52
57
|
s.files = `git ls-files`.split($RS)
|
53
58
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
54
59
|
s.test_files = s.files.grep(%r{^(test|features)/})
|
@@ -80,7 +85,9 @@ and suggests a different architecture for digital wallet maintenance.'
|
|
80
85
|
s.add_runtime_dependency 'zold-score', '0.2.2'
|
81
86
|
s.add_development_dependency 'codecov', '0.1.13'
|
82
87
|
s.add_development_dependency 'minitest', '5.11.3'
|
88
|
+
s.add_development_dependency 'minitest-fail-fast', '0.1.0'
|
83
89
|
s.add_development_dependency 'minitest-hooks', '1.5.0'
|
90
|
+
s.add_development_dependency 'patron', '0.13.1'
|
84
91
|
s.add_development_dependency 'random-port', '0.3.1'
|
85
92
|
s.add_development_dependency 'rdoc', '4.3.0'
|
86
93
|
s.add_development_dependency 'rspec-rails', '3.8.1'
|
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.16.
|
4
|
+
version: 0.16.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|
@@ -374,6 +374,20 @@ dependencies:
|
|
374
374
|
- - '='
|
375
375
|
- !ruby/object:Gem::Version
|
376
376
|
version: 5.11.3
|
377
|
+
- !ruby/object:Gem::Dependency
|
378
|
+
name: minitest-fail-fast
|
379
|
+
requirement: !ruby/object:Gem::Requirement
|
380
|
+
requirements:
|
381
|
+
- - '='
|
382
|
+
- !ruby/object:Gem::Version
|
383
|
+
version: 0.1.0
|
384
|
+
type: :development
|
385
|
+
prerelease: false
|
386
|
+
version_requirements: !ruby/object:Gem::Requirement
|
387
|
+
requirements:
|
388
|
+
- - '='
|
389
|
+
- !ruby/object:Gem::Version
|
390
|
+
version: 0.1.0
|
377
391
|
- !ruby/object:Gem::Dependency
|
378
392
|
name: minitest-hooks
|
379
393
|
requirement: !ruby/object:Gem::Requirement
|
@@ -388,6 +402,20 @@ dependencies:
|
|
388
402
|
- - '='
|
389
403
|
- !ruby/object:Gem::Version
|
390
404
|
version: 1.5.0
|
405
|
+
- !ruby/object:Gem::Dependency
|
406
|
+
name: patron
|
407
|
+
requirement: !ruby/object:Gem::Requirement
|
408
|
+
requirements:
|
409
|
+
- - '='
|
410
|
+
- !ruby/object:Gem::Version
|
411
|
+
version: 0.13.1
|
412
|
+
type: :development
|
413
|
+
prerelease: false
|
414
|
+
version_requirements: !ruby/object:Gem::Requirement
|
415
|
+
requirements:
|
416
|
+
- - '='
|
417
|
+
- !ruby/object:Gem::Version
|
418
|
+
version: 0.13.1
|
391
419
|
- !ruby/object:Gem::Dependency
|
392
420
|
name: random-port
|
393
421
|
requirement: !ruby/object:Gem::Requirement
|
@@ -666,7 +694,12 @@ homepage: http://github.com/zold-io/zold
|
|
666
694
|
licenses:
|
667
695
|
- MIT
|
668
696
|
metadata: {}
|
669
|
-
post_install_message:
|
697
|
+
post_install_message: |-
|
698
|
+
Thanks for installing Zold 0.16.25!
|
699
|
+
Study our White Paper: https://papers.zold.io/wp.pdf
|
700
|
+
Read our blog posts: https://blog.zold.io
|
701
|
+
Stay in touch with the dev community: https://t.me/zold_io
|
702
|
+
Follow us on Twitter: https://twitter.com/0crat
|
670
703
|
rdoc_options:
|
671
704
|
- "--charset=UTF-8"
|
672
705
|
require_paths:
|