zold 0.31.10 → 0.32.0
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/.0pdd.yml +2 -19
- data/.github/typos.toml +11 -0
- data/.github/workflows/actionlint.yml +5 -21
- data/.github/workflows/bashate.yml +25 -0
- data/.github/workflows/codecov.yml +11 -24
- data/.github/workflows/copyrights.yml +6 -21
- data/.github/workflows/hadolint.yml +14 -0
- data/.github/workflows/markdown-lint.yml +19 -0
- data/.github/workflows/pdd.yml +5 -20
- data/.github/workflows/rake.yml +8 -22
- data/.github/workflows/reuse.yml +19 -0
- data/.github/workflows/shellcheck.yml +19 -0
- data/.github/workflows/typos.yml +21 -0
- data/.github/workflows/xcop.yml +5 -20
- data/.github/workflows/yamllint.yml +5 -20
- data/.gitignore +9 -6
- data/.rubocop.yml +16 -20
- data/.ruby-version +1 -1
- data/.rultor.yml +6 -22
- data/Dockerfile +11 -27
- data/Gemfile +21 -33
- data/Gemfile.lock +181 -126
- data/Guardfile +0 -0
- data/INSTALL.md +80 -59
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +183 -154
- data/REUSE.toml +40 -0
- data/Rakefile +4 -38
- data/bin/zold +7 -37
- data/cucumber.yml +2 -19
- data/deploy.sh +4 -22
- data/features/cli.feature +2 -0
- data/features/gem_package.feature +2 -0
- data/features/step_definitions/steps.rb +2 -19
- data/features/support/env.rb +2 -19
- data/fixtures/merge/asserts.rb +3 -19
- data/fixtures/merge/into_no_wallet/assert.rb +2 -19
- data/fixtures/merge/legacy_negatives_stay/assert.rb +2 -19
- data/fixtures/merge/legacy_negatives_stay/copies/0123456789abcdef/scores.zc +1 -1
- data/fixtures/merge/missed_wallets/0123456789abcdef.z +0 -2
- data/fixtures/merge/missed_wallets/assert.rb +2 -19
- data/fixtures/merge/missed_wallets/copies/0123456789abcdef/scores.zc +1 -1
- data/fixtures/merge/negative_overwriting/assert.rb +2 -19
- data/fixtures/merge/negatives_in_between/0123456789abcdef.z +0 -1
- data/fixtures/merge/negatives_in_between/assert.rb +2 -19
- data/fixtures/merge/negatives_in_between/copies/0123456789abcdef/2.zc +0 -1
- data/fixtures/merge/negatives_in_between/opts +1 -1
- data/fixtures/merge/random_expenses/assert.rb +2 -19
- data/fixtures/merge/random_expenses/opts +1 -1
- data/fixtures/merge/simple_case/assert.rb +2 -19
- data/fixtures/merge/simple_case/opts +1 -1
- data/fixtures/merge/unconfirmed_income/assert.rb +2 -19
- data/fixtures/scripts/_head.sh +16 -33
- data/fixtures/scripts/calculate-scores.sh +3 -20
- data/fixtures/scripts/distribute-wallet.sh +26 -43
- data/fixtures/scripts/print-helps.sh +5 -23
- data/fixtures/scripts/pull-on-start.sh +12 -29
- data/fixtures/scripts/push-and-pull.sh +10 -27
- data/fixtures/scripts/redeploy-on-upgrade.sh +18 -34
- data/fixtures/scripts/spread-wallets.sh +24 -40
- data/lib/zold/age.rb +3 -20
- data/lib/zold/amount.rb +3 -20
- data/lib/zold/cached_wallets.rb +3 -20
- data/lib/zold/commands/alias.rb +4 -21
- data/lib/zold/commands/args.rb +4 -21
- data/lib/zold/commands/calculate.rb +5 -22
- data/lib/zold/commands/clean.rb +6 -23
- data/lib/zold/commands/create.rb +5 -22
- data/lib/zold/commands/diff.rb +5 -22
- data/lib/zold/commands/fetch.rb +6 -23
- data/lib/zold/commands/invoice.rb +5 -22
- data/lib/zold/commands/list.rb +5 -22
- data/lib/zold/commands/merge.rb +7 -24
- data/lib/zold/commands/next.rb +5 -22
- data/lib/zold/commands/node.rb +4 -21
- data/lib/zold/commands/pay.rb +6 -23
- data/lib/zold/commands/propagate.rb +5 -22
- data/lib/zold/commands/pull.rb +5 -22
- data/lib/zold/commands/push.rb +5 -22
- data/lib/zold/commands/remote.rb +7 -24
- data/lib/zold/commands/remove.rb +5 -22
- data/lib/zold/commands/routines/audit.rb +4 -21
- data/lib/zold/commands/routines/gc.rb +6 -23
- data/lib/zold/commands/routines/reconcile.rb +5 -22
- data/lib/zold/commands/routines/reconnect.rb +4 -21
- data/lib/zold/commands/routines/retire.rb +4 -21
- data/lib/zold/commands/routines/spread.rb +5 -22
- data/lib/zold/commands/routines.rb +3 -20
- data/lib/zold/commands/show.rb +5 -22
- data/lib/zold/commands/taxes.rb +5 -22
- data/lib/zold/commands/thread_badge.rb +3 -20
- data/lib/zold/copies.rb +6 -25
- data/lib/zold/dir_items.rb +3 -20
- data/lib/zold/endless.rb +5 -22
- data/lib/zold/gem.rb +3 -20
- data/lib/zold/hands.rb +6 -23
- data/lib/zold/head.rb +4 -21
- data/lib/zold/hexnum.rb +3 -20
- data/lib/zold/http.rb +3 -20
- data/lib/zold/hungry_wallets.rb +6 -23
- data/lib/zold/id.rb +3 -20
- data/lib/zold/json_page.rb +5 -22
- data/lib/zold/key.rb +3 -20
- data/lib/zold/metronome.rb +5 -22
- data/lib/zold/node/async_entrance.rb +6 -23
- data/lib/zold/node/entrance.rb +7 -24
- data/lib/zold/node/farm.rb +5 -22
- data/lib/zold/node/farmers.rb +15 -32
- data/lib/zold/node/front.rb +6 -23
- data/lib/zold/node/journaled_pipeline.rb +8 -25
- data/lib/zold/node/nodup_entrance.rb +6 -23
- data/lib/zold/node/nospam_entrance.rb +6 -23
- data/lib/zold/node/pipeline.rb +6 -23
- data/lib/zold/node/safe_entrance.rb +4 -22
- data/lib/zold/node/soft_error.rb +3 -20
- data/lib/zold/node/spread_entrance.rb +5 -22
- data/lib/zold/node/sync_entrance.rb +5 -22
- data/lib/zold/node/trace.rb +3 -20
- data/lib/zold/patch.rb +6 -23
- data/lib/zold/prefixes.rb +3 -20
- data/lib/zold/remotes.rb +5 -22
- data/lib/zold/signature.rb +3 -20
- data/lib/zold/size.rb +3 -20
- data/lib/zold/sync_wallets.rb +5 -22
- data/lib/zold/tax.rb +4 -21
- data/lib/zold/thread_pool.rb +4 -21
- data/lib/zold/tree_wallets.rb +3 -20
- data/lib/zold/txn.rb +4 -21
- data/lib/zold/txns.rb +4 -21
- data/lib/zold/upgrades.rb +4 -21
- data/lib/zold/verbose_thread.rb +5 -22
- data/lib/zold/version.rb +4 -21
- data/lib/zold/version_file.rb +4 -21
- data/lib/zold/wallet.rb +6 -23
- data/lib/zold/wallets.rb +5 -23
- data/lib/zold.rb +3 -21
- data/resources/banned-wallets.log +6 -6
- data/test/commands/routines/test_audit.rb +3 -21
- data/test/commands/routines/test_gc.rb +3 -21
- data/test/commands/routines/test_reconcile.rb +3 -21
- data/test/commands/routines/test_reconnect.rb +3 -21
- data/test/commands/routines/test_retire.rb +3 -21
- data/test/commands/test_alias.rb +2 -20
- data/test/commands/test_calculate.rb +5 -23
- data/test/commands/test_clean.rb +5 -23
- data/test/commands/test_create.rb +6 -24
- data/test/commands/test_diff.rb +4 -22
- data/test/commands/test_fetch.rb +3 -21
- data/test/commands/test_invoice.rb +3 -21
- data/test/commands/test_list.rb +3 -21
- data/test/commands/test_merge.rb +12 -35
- data/test/commands/test_node.rb +3 -21
- data/test/commands/test_pay.rb +5 -23
- data/test/commands/test_propagate.rb +6 -24
- data/test/commands/test_pull.rb +4 -22
- data/test/commands/test_push.rb +3 -21
- data/test/commands/test_remote.rb +10 -28
- data/test/commands/test_remove.rb +7 -25
- data/test/commands/test_show.rb +3 -21
- data/test/commands/test_taxes.rb +5 -23
- data/test/fake_home.rb +5 -22
- data/test/node/fake_entrance.rb +3 -20
- data/test/node/fake_node.rb +5 -22
- data/test/node/test_async_entrance.rb +3 -21
- data/test/node/test_entrance.rb +7 -25
- data/test/node/test_farm.rb +15 -33
- data/test/node/test_farmers.rb +3 -21
- data/test/node/test_front.rb +22 -42
- data/test/node/test_nodup_entrance.rb +4 -22
- data/test/node/test_nospam_entrance.rb +6 -24
- data/test/node/test_safe_entrance.rb +3 -21
- data/test/node/test_spread_entrance.rb +4 -22
- data/test/node/test_sync_entrance.rb +4 -22
- data/test/node/test_trace.rb +4 -22
- data/test/test__helper.rb +32 -31
- data/test/test_age.rb +5 -23
- data/test/test_amount.rb +15 -34
- data/test/test_cached_wallets.rb +3 -21
- data/test/test_copies.rb +10 -28
- data/test/test_dir_items.rb +4 -22
- data/test/test_gem.rb +3 -21
- data/test/test_hands.rb +3 -21
- data/test/test_hexnum.rb +3 -21
- data/test/test_http.rb +9 -27
- data/test/test_hungry_wallets.rb +6 -24
- data/test/test_id.rb +10 -28
- data/test/test_json_page.rb +3 -21
- data/test/test_key.rb +5 -23
- data/test/test_metronome.rb +6 -24
- data/test/test_patch.rb +10 -28
- data/test/test_prefixes.rb +3 -21
- data/test/test_remotes.rb +17 -35
- data/test/test_signature.rb +3 -21
- data/test/test_size.rb +3 -21
- data/test/test_sync_wallets.rb +3 -21
- data/test/test_tax.rb +6 -24
- data/test/test_thread_pool.rb +6 -24
- data/test/test_tree_wallets.rb +4 -22
- data/test/test_txn.rb +3 -21
- data/test/test_upgrades.rb +3 -21
- data/test/test_verbose_thread.rb +6 -24
- data/test/test_version.rb +2 -20
- data/test/test_wallet.rb +15 -33
- data/test/test_wallets.rb +4 -22
- data/test/test_zold.rb +7 -25
- data/test/upgrades/test_delete_banned_wallets.rb +4 -22
- data/test/upgrades/test_protocol_up.rb +3 -21
- data/upgrades/2.rb +3 -20
- data/upgrades/delete_banned_wallets.rb +3 -20
- data/upgrades/move_wallets_into_tree.rb +3 -20
- data/upgrades/protocol_up.rb +3 -20
- data/upgrades/rename_foreign_wallets.rb +3 -20
- data/views/journal.haml +25 -0
- data/views/layout.haml +25 -0
- data/views/wallet.haml +25 -0
- data/zold.gemspec +5 -21
- metadata +33 -15
- data/.simplecov +0 -36
- data/lib/zold/log.rb +0 -139
- data/test/test_log.rb +0 -49
data/test/test_patch.rb
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require_relative 'fake_home'
|
|
25
7
|
require_relative 'test__helper'
|
|
26
8
|
require_relative '../lib/zold/key'
|
|
@@ -32,7 +14,7 @@ require_relative '../lib/zold/patch'
|
|
|
32
14
|
|
|
33
15
|
# Patch test.
|
|
34
16
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
35
|
-
# Copyright:: Copyright (c) 2018-
|
|
17
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
36
18
|
# License:: MIT
|
|
37
19
|
class TestPatch < Zold::Test
|
|
38
20
|
def test_builds_patch
|
|
@@ -53,7 +35,7 @@ class TestPatch < Zold::Test
|
|
|
53
35
|
patch.join(first) { false }
|
|
54
36
|
patch.join(second) { false }
|
|
55
37
|
patch.join(third) { false }
|
|
56
|
-
|
|
38
|
+
assert(patch.save(first.path, overwrite: true, allow_negative_balance: true))
|
|
57
39
|
assert_equal(Zold::Amount.new(zld: -53.0), first.balance)
|
|
58
40
|
end
|
|
59
41
|
end
|
|
@@ -67,7 +49,7 @@ class TestPatch < Zold::Test
|
|
|
67
49
|
patch = Zold::Patch.new(home.wallets, log: fake_log)
|
|
68
50
|
patch.join(first) { false }
|
|
69
51
|
patch.join(second) { false }
|
|
70
|
-
|
|
52
|
+
refute(patch.save(first.path, overwrite: true))
|
|
71
53
|
first.flush
|
|
72
54
|
assert_equal(Zold::Amount::ZERO, first.balance)
|
|
73
55
|
end
|
|
@@ -84,7 +66,7 @@ class TestPatch < Zold::Test
|
|
|
84
66
|
patch = Zold::Patch.new(home.wallets, log: fake_log)
|
|
85
67
|
patch.join(first) { false }
|
|
86
68
|
patch.join(second) { false }
|
|
87
|
-
|
|
69
|
+
assert(patch.save(first.path, overwrite: true))
|
|
88
70
|
first.flush
|
|
89
71
|
assert_equal(amount * -1, first.balance)
|
|
90
72
|
end
|
|
@@ -106,7 +88,7 @@ class TestPatch < Zold::Test
|
|
|
106
88
|
patch = Zold::Patch.new(home.wallets, log: fake_log)
|
|
107
89
|
patch.join(first) { false }
|
|
108
90
|
patch.join(second) { false }
|
|
109
|
-
|
|
91
|
+
assert(patch.save(first.path, overwrite: true))
|
|
110
92
|
first.flush
|
|
111
93
|
assert_equal(Zold::Amount.new(zld: 2.0).to_s, first.balance.to_s)
|
|
112
94
|
end
|
|
@@ -140,7 +122,7 @@ class TestPatch < Zold::Test
|
|
|
140
122
|
patch = Zold::Patch.new(home.wallets, log: fake_log)
|
|
141
123
|
patch.join(first) { false }
|
|
142
124
|
patch.join(second) { false }
|
|
143
|
-
|
|
125
|
+
assert(patch.save(first.path, overwrite: true))
|
|
144
126
|
first.flush
|
|
145
127
|
assert_equal(3, first.txns.count)
|
|
146
128
|
assert_equal(Zold::Amount.new(zld: -6.0).to_s, first.balance.to_s)
|
|
@@ -164,9 +146,9 @@ class TestPatch < Zold::Test
|
|
|
164
146
|
lines = File.read(f).split("\n")
|
|
165
147
|
assert_equal(2, lines.count)
|
|
166
148
|
parts = lines[0].split(';')
|
|
167
|
-
|
|
149
|
+
refute_nil(Zold::Txn.parse_time(parts[0]))
|
|
168
150
|
assert_equal(1, parts[1].to_i)
|
|
169
|
-
|
|
151
|
+
refute_nil(Zold::Txn.parse_time(parts[2]))
|
|
170
152
|
assert_equal(Zold::Id::ROOT.to_s, parts[3])
|
|
171
153
|
assert_equal(target.to_s, parts[4])
|
|
172
154
|
assert_equal(amount, Zold::Amount.new(zents: parts[5].to_i))
|
data/test/test_prefixes.rb
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'tmpdir'
|
|
25
7
|
require_relative 'fake_home'
|
|
26
8
|
require_relative '../lib/zold/key'
|
|
@@ -30,7 +12,7 @@ require_relative '../lib/zold/prefixes'
|
|
|
30
12
|
|
|
31
13
|
# Prefixes test.
|
|
32
14
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
33
|
-
# Copyright:: Copyright (c) 2018-
|
|
15
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
34
16
|
# License:: MIT
|
|
35
17
|
class TestPrefixes < Zold::Test
|
|
36
18
|
def test_creates_and_validates
|
data/test/test_remotes.rb
CHANGED
|
@@ -1,38 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'tmpdir'
|
|
25
7
|
require 'webmock/minitest'
|
|
26
8
|
require 'threads'
|
|
27
9
|
require_relative 'test__helper'
|
|
28
|
-
|
|
10
|
+
require 'loog'
|
|
29
11
|
require_relative '../lib/zold/age'
|
|
30
12
|
require_relative '../lib/zold/remotes'
|
|
31
13
|
require_relative '../lib/zold/verbose_thread'
|
|
32
14
|
|
|
33
15
|
# Remotes test.
|
|
34
16
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
35
|
-
# Copyright:: Copyright (c) 2018-
|
|
17
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
36
18
|
# License:: MIT
|
|
37
19
|
class TestRemotes < Zold::Test
|
|
38
20
|
def test_adds_remotes
|
|
@@ -41,7 +23,7 @@ class TestRemotes < Zold::Test
|
|
|
41
23
|
FileUtils.touch(file)
|
|
42
24
|
remotes = Zold::Remotes.new(file: file)
|
|
43
25
|
remotes.add('127.0.0.1')
|
|
44
|
-
|
|
26
|
+
assert_equal(1, remotes.all.count)
|
|
45
27
|
end
|
|
46
28
|
end
|
|
47
29
|
|
|
@@ -65,7 +47,7 @@ class TestRemotes < Zold::Test
|
|
|
65
47
|
].each do |t|
|
|
66
48
|
File.write(file, t)
|
|
67
49
|
remotes = Zold::Remotes.new(file: file)
|
|
68
|
-
|
|
50
|
+
assert_empty(remotes.all, remotes.all)
|
|
69
51
|
end
|
|
70
52
|
end
|
|
71
53
|
end
|
|
@@ -77,8 +59,8 @@ class TestRemotes < Zold::Test
|
|
|
77
59
|
remotes = Zold::Remotes.new(file: file)
|
|
78
60
|
ips = (0..50)
|
|
79
61
|
ips.each { |i| remotes.add("0.0.0.#{i + 1}", 9999) }
|
|
80
|
-
remotes.iterate(
|
|
81
|
-
ips.each { |i|
|
|
62
|
+
remotes.iterate(Loog::NULL) { raise 'Intended' }
|
|
63
|
+
ips.each { |i| assert_equal(1, remotes.all[i][:errors]) }
|
|
82
64
|
end
|
|
83
65
|
end
|
|
84
66
|
|
|
@@ -89,7 +71,7 @@ class TestRemotes < Zold::Test
|
|
|
89
71
|
remotes = Zold::Remotes.new(file: file)
|
|
90
72
|
5.times { |i| remotes.add("0.0.0.#{i + 1}", 9999) }
|
|
91
73
|
total = 0
|
|
92
|
-
remotes.iterate(
|
|
74
|
+
remotes.iterate(Loog::NULL) do
|
|
93
75
|
total += 1
|
|
94
76
|
raise 'Intended'
|
|
95
77
|
end
|
|
@@ -104,7 +86,7 @@ class TestRemotes < Zold::Test
|
|
|
104
86
|
remotes = Zold::Remotes.new(file: file)
|
|
105
87
|
5.times { |i| remotes.add("0.0.0.#{i + 1}", 9999) }
|
|
106
88
|
total = 0
|
|
107
|
-
remotes.iterate(
|
|
89
|
+
remotes.iterate(Loog::NULL) do
|
|
108
90
|
sleep 0.25
|
|
109
91
|
total += 1
|
|
110
92
|
end
|
|
@@ -158,7 +140,7 @@ class TestRemotes < Zold::Test
|
|
|
158
140
|
remotes.add('127.0.0.1')
|
|
159
141
|
remotes.add('LOCALHOST', 433)
|
|
160
142
|
remotes.remove('localhost', 433)
|
|
161
|
-
|
|
143
|
+
assert_equal(1, remotes.all.count)
|
|
162
144
|
end
|
|
163
145
|
end
|
|
164
146
|
|
|
@@ -168,7 +150,7 @@ class TestRemotes < Zold::Test
|
|
|
168
150
|
remotes.clean
|
|
169
151
|
remotes.masters
|
|
170
152
|
remotes.masters
|
|
171
|
-
|
|
153
|
+
refute_empty(remotes.all)
|
|
172
154
|
end
|
|
173
155
|
end
|
|
174
156
|
|
|
@@ -204,7 +186,7 @@ class TestRemotes < Zold::Test
|
|
|
204
186
|
Threads.new(5).assert do
|
|
205
187
|
remotes.error(host)
|
|
206
188
|
end
|
|
207
|
-
assert_equal(0, remotes.all.
|
|
189
|
+
assert_equal(0, remotes.all.count { |r| r[:host] != host })
|
|
208
190
|
end
|
|
209
191
|
end
|
|
210
192
|
|
|
@@ -266,11 +248,11 @@ class TestRemotes < Zold::Test
|
|
|
266
248
|
remotes = Zold::Remotes.new(file: File.join(dir, 'uu-90.csv'))
|
|
267
249
|
remotes.clean
|
|
268
250
|
remotes.add('192.168.0.1', 8081)
|
|
269
|
-
assert_equal remotes.all.last[:errors]
|
|
251
|
+
assert_equal 0, remotes.all.last[:errors]
|
|
270
252
|
remotes.error('192.168.0.1', 8081)
|
|
271
|
-
assert_equal remotes.all.last[:errors]
|
|
253
|
+
assert_equal 1, remotes.all.last[:errors]
|
|
272
254
|
remotes.unerror('192.168.0.1', 8081)
|
|
273
|
-
assert_equal remotes.all.last[:errors]
|
|
255
|
+
assert_equal 0, remotes.all.last[:errors]
|
|
274
256
|
end
|
|
275
257
|
end
|
|
276
258
|
|
|
@@ -283,7 +265,7 @@ class TestRemotes < Zold::Test
|
|
|
283
265
|
|
|
284
266
|
def test_reads_mtime_from_empty_file
|
|
285
267
|
Dir.mktmpdir do |dir|
|
|
286
|
-
|
|
268
|
+
refute_nil(Zold::Remotes.new(file: File.join(dir, 'file/is/absent')).mtime)
|
|
287
269
|
end
|
|
288
270
|
end
|
|
289
271
|
|
data/test/test_signature.rb
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'tmpdir'
|
|
25
7
|
require_relative 'test__helper'
|
|
26
8
|
require_relative '../lib/zold/key'
|
|
@@ -31,7 +13,7 @@ require_relative '../lib/zold/signature'
|
|
|
31
13
|
|
|
32
14
|
# Signature test.
|
|
33
15
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
34
|
-
# Copyright:: Copyright (c) 2018-
|
|
16
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
35
17
|
# License:: MIT
|
|
36
18
|
class TestSignature < Zold::Test
|
|
37
19
|
def test_signs_and_validates
|
data/test/test_size.rb
CHANGED
|
@@ -1,32 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require_relative 'test__helper'
|
|
25
7
|
require_relative '../lib/zold/size'
|
|
26
8
|
|
|
27
9
|
# Size test.
|
|
28
10
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
29
|
-
# Copyright:: Copyright (c) 2018-
|
|
11
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
30
12
|
# License:: MIT
|
|
31
13
|
class TestSize < Zold::Test
|
|
32
14
|
def test_prints_size
|
data/test/test_sync_wallets.rb
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'concurrent'
|
|
25
7
|
require 'threads'
|
|
26
8
|
require_relative 'test__helper'
|
|
@@ -33,7 +15,7 @@ require_relative '../lib/zold/amount'
|
|
|
33
15
|
|
|
34
16
|
# SyncWallets test.
|
|
35
17
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
36
|
-
# Copyright:: Copyright (c) 2018-
|
|
18
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
37
19
|
# License:: MIT
|
|
38
20
|
class TestSyncWallets < Zold::Test
|
|
39
21
|
def test_adds_wallet
|
data/test/test_tax.rb
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'zold/score'
|
|
25
7
|
require 'time'
|
|
26
8
|
require_relative 'test__helper'
|
|
@@ -35,7 +17,7 @@ require_relative '../lib/zold/prefixes'
|
|
|
35
17
|
|
|
36
18
|
# Tax test.
|
|
37
19
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
38
|
-
# Copyright:: Copyright (c) 2018-
|
|
20
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
39
21
|
# License:: MIT
|
|
40
22
|
class TestTax < Zold::Test
|
|
41
23
|
def test_print_fee
|
|
@@ -87,7 +69,7 @@ class TestTax < Zold::Test
|
|
|
87
69
|
FakeHome.new(log: fake_log).run do |home|
|
|
88
70
|
wallet = home.create_wallet
|
|
89
71
|
tax = Zold::Tax.new(wallet)
|
|
90
|
-
|
|
72
|
+
refute_nil(tax.to_text)
|
|
91
73
|
end
|
|
92
74
|
end
|
|
93
75
|
|
|
@@ -107,7 +89,7 @@ class TestTax < Zold::Test
|
|
|
107
89
|
)
|
|
108
90
|
tax = Zold::Tax.new(wallet, strength: 6)
|
|
109
91
|
assert_equal(amount, tax.paid)
|
|
110
|
-
|
|
92
|
+
assert_operator(tax.debt, :<, Zold::Amount::ZERO, tax.debt)
|
|
111
93
|
end
|
|
112
94
|
end
|
|
113
95
|
|
|
@@ -165,7 +147,7 @@ class TestTax < Zold::Test
|
|
|
165
147
|
)
|
|
166
148
|
tax.pay(Zold::Key.new(file: 'fixtures/id_rsa'), score)
|
|
167
149
|
assert(tax.exists?(tax.details(score)))
|
|
168
|
-
|
|
150
|
+
refute(tax.exists?('-'))
|
|
169
151
|
end
|
|
170
152
|
end
|
|
171
153
|
end
|
data/test/test_thread_pool.rb
CHANGED
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'concurrent'
|
|
25
7
|
require_relative 'test__helper'
|
|
26
8
|
require_relative '../lib/zold/thread_pool'
|
|
27
9
|
|
|
28
10
|
# ThreadPool test.
|
|
29
11
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2018-
|
|
12
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
31
13
|
# License:: MIT
|
|
32
14
|
class TestThreadPool < Zold::Test
|
|
33
15
|
def test_closes_all_threads_right
|
|
@@ -74,16 +56,16 @@ class TestThreadPool < Zold::Test
|
|
|
74
56
|
# forever
|
|
75
57
|
end
|
|
76
58
|
end
|
|
77
|
-
|
|
59
|
+
assert_kind_of(Array, pool.to_json)
|
|
78
60
|
assert_equal('test', pool.to_json[0][:name])
|
|
79
61
|
assert_equal('run', pool.to_json[0][:status])
|
|
80
|
-
|
|
62
|
+
assert(pool.to_json[0][:alive])
|
|
81
63
|
assert_equal(1, pool.to_json[0][:vars]['foo'])
|
|
82
64
|
pool.kill
|
|
83
65
|
end
|
|
84
66
|
|
|
85
67
|
def test_prints_to_text
|
|
86
68
|
pool = Zold::ThreadPool.new('test', log: fake_log)
|
|
87
|
-
|
|
69
|
+
refute_nil(pool.to_s)
|
|
88
70
|
end
|
|
89
71
|
end
|
data/test/test_tree_wallets.rb
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'tmpdir'
|
|
25
7
|
require_relative 'test__helper'
|
|
26
8
|
require_relative '../lib/zold/wallet'
|
|
@@ -30,7 +12,7 @@ require_relative '../lib/zold/tree_wallets'
|
|
|
30
12
|
|
|
31
13
|
# TreeWallets test.
|
|
32
14
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
33
|
-
# Copyright:: Copyright (c) 2018-
|
|
15
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
34
16
|
# License:: MIT
|
|
35
17
|
class TestTreeWallets < Zold::Test
|
|
36
18
|
def test_adds_wallet
|
|
@@ -39,7 +21,7 @@ class TestTreeWallets < Zold::Test
|
|
|
39
21
|
id = Zold::Id.new('abcd0123abcd0123')
|
|
40
22
|
wallets.acq(id, exclusive: true) do |wallet|
|
|
41
23
|
wallet.init(id, Zold::Key.new(file: 'fixtures/id_rsa.pub'))
|
|
42
|
-
assert(wallet.path.end_with?('/a/b/c/d/abcd0123abcd0123.z')
|
|
24
|
+
assert(wallet.path.end_with?('/a/b/c/d/abcd0123abcd0123.z'))
|
|
43
25
|
end
|
|
44
26
|
assert_equal(1, wallets.all.count)
|
|
45
27
|
assert_equal(id, wallets.all[0])
|
data/test/test_txn.rb
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require 'tmpdir'
|
|
25
7
|
require 'time'
|
|
26
8
|
require_relative 'test__helper'
|
|
@@ -30,7 +12,7 @@ require_relative '../lib/zold/amount'
|
|
|
30
12
|
|
|
31
13
|
# Txn test.
|
|
32
14
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
33
|
-
# Copyright:: Copyright (c) 2018-
|
|
15
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
34
16
|
# License:: MIT
|
|
35
17
|
class TestTxn < Zold::Test
|
|
36
18
|
def test_prints_and_parses
|
data/test/test_upgrades.rb
CHANGED
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
|
-
require 'minitest/autorun'
|
|
24
6
|
require_relative 'test__helper'
|
|
25
7
|
require_relative '../lib/zold/upgrades'
|
|
26
8
|
require_relative '../lib/zold/version_file'
|
|
27
9
|
|
|
28
10
|
# Upgrade test.
|
|
29
11
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2018-
|
|
12
|
+
# Copyright:: Copyright (c) 2018-2025 Zerocracy
|
|
31
13
|
# License:: MIT
|
|
32
14
|
class TestUpgrades < Zold::Test
|
|
33
15
|
# @todo #327:30min Uncomment, when you're ready to work on upgrade manager's
|