zold 0.21.1 → 0.21.2
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/.rubocop.yml +1 -1
- data/.rultor.yml +0 -16
- data/.simplecov +1 -1
- data/Gemfile +2 -2
- data/Rakefile +3 -2
- data/bin/zold +1 -1
- data/features/step_definitions/steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/fixtures/merge/asserts.rb +1 -1
- data/fixtures/merge/into-no-wallet/assert.rb +1 -1
- data/fixtures/merge/random-expenses/assert.rb +1 -1
- data/fixtures/merge/simple-case/assert.rb +1 -1
- data/lib/zold.rb +1 -1
- data/lib/zold/age.rb +1 -1
- data/lib/zold/amount.rb +1 -1
- data/lib/zold/cached_wallets.rb +1 -1
- data/lib/zold/commands/args.rb +1 -1
- data/lib/zold/commands/calculate.rb +1 -1
- data/lib/zold/commands/clean.rb +1 -1
- data/lib/zold/commands/create.rb +1 -1
- data/lib/zold/commands/diff.rb +1 -1
- data/lib/zold/commands/fetch.rb +1 -1
- data/lib/zold/commands/invoice.rb +1 -1
- data/lib/zold/commands/list.rb +1 -1
- data/lib/zold/commands/merge.rb +1 -1
- data/lib/zold/commands/next.rb +1 -1
- data/lib/zold/commands/node.rb +1 -1
- data/lib/zold/commands/pay.rb +1 -1
- data/lib/zold/commands/propagate.rb +1 -1
- data/lib/zold/commands/pull.rb +1 -1
- data/lib/zold/commands/push.rb +5 -5
- data/lib/zold/commands/remote.rb +1 -1
- data/lib/zold/commands/remove.rb +1 -1
- data/lib/zold/commands/routines/audit.rb +1 -1
- data/lib/zold/commands/routines/gc.rb +1 -1
- data/lib/zold/commands/routines/reconnect.rb +1 -1
- data/lib/zold/commands/show.rb +1 -1
- data/lib/zold/commands/taxes.rb +1 -1
- data/lib/zold/commands/thread_badge.rb +1 -1
- data/lib/zold/copies.rb +1 -1
- data/lib/zold/dir_items.rb +2 -2
- data/lib/zold/endless.rb +1 -1
- data/lib/zold/gem.rb +1 -1
- data/lib/zold/head.rb +1 -1
- data/lib/zold/hexnum.rb +1 -1
- data/lib/zold/http.rb +1 -1
- data/lib/zold/hungry_wallets.rb +1 -1
- data/lib/zold/id.rb +1 -1
- data/lib/zold/json_page.rb +1 -1
- data/lib/zold/key.rb +1 -1
- data/lib/zold/log.rb +1 -1
- data/lib/zold/metronome.rb +1 -1
- data/lib/zold/node/async_entrance.rb +1 -1
- data/lib/zold/node/emission.rb +1 -1
- data/lib/zold/node/entrance.rb +1 -1
- data/lib/zold/node/farm.rb +2 -2
- data/lib/zold/node/farmers.rb +1 -1
- data/lib/zold/node/front.rb +17 -1
- data/lib/zold/node/nodup_entrance.rb +1 -1
- data/lib/zold/node/nospam_entrance.rb +1 -1
- data/lib/zold/node/safe_entrance.rb +1 -1
- data/lib/zold/node/soft_error.rb +1 -1
- data/lib/zold/node/spread_entrance.rb +1 -1
- data/lib/zold/node/sync_entrance.rb +1 -1
- data/lib/zold/node/trace.rb +1 -1
- data/lib/zold/patch.rb +1 -1
- data/lib/zold/prefixes.rb +1 -1
- data/lib/zold/remotes.rb +1 -1
- data/lib/zold/signature.rb +1 -1
- data/lib/zold/size.rb +4 -3
- data/lib/zold/sync_wallets.rb +1 -1
- data/lib/zold/tax.rb +1 -1
- data/lib/zold/thread_pool.rb +2 -1
- data/lib/zold/tree_wallets.rb +1 -1
- data/lib/zold/txn.rb +11 -1
- data/lib/zold/txns.rb +1 -1
- data/lib/zold/upgrades.rb +1 -1
- data/lib/zold/verbose_thread.rb +1 -1
- data/lib/zold/version.rb +2 -2
- data/lib/zold/version_file.rb +1 -1
- data/lib/zold/wallet.rb +1 -1
- data/lib/zold/wallets.rb +1 -1
- data/resources/masters +0 -1
- data/test/commands/routines/test_audit.rb +1 -1
- data/test/commands/routines/test_gc.rb +1 -1
- data/test/commands/routines/test_reconnect.rb +1 -1
- data/test/commands/test_calculate.rb +1 -1
- data/test/commands/test_clean.rb +1 -1
- data/test/commands/test_create.rb +1 -1
- data/test/commands/test_diff.rb +1 -1
- data/test/commands/test_fetch.rb +1 -1
- data/test/commands/test_invoice.rb +1 -1
- data/test/commands/test_list.rb +1 -1
- data/test/commands/test_merge.rb +1 -1
- data/test/commands/test_node.rb +1 -1
- data/test/commands/test_pay.rb +1 -1
- data/test/commands/test_propagate.rb +1 -1
- data/test/commands/test_pull.rb +1 -1
- data/test/commands/test_push.rb +1 -1
- data/test/commands/test_remote.rb +1 -1
- data/test/commands/test_remove.rb +1 -1
- data/test/commands/test_show.rb +1 -1
- data/test/commands/test_taxes.rb +1 -1
- data/test/fake_home.rb +1 -1
- data/test/node/fake_entrance.rb +1 -1
- data/test/node/fake_node.rb +1 -1
- data/test/node/test_async_entrance.rb +1 -1
- data/test/node/test_emission.rb +1 -1
- data/test/node/test_entrance.rb +1 -1
- data/test/node/test_farm.rb +1 -1
- data/test/node/test_farmers.rb +1 -1
- data/test/node/test_front.rb +16 -1
- data/test/node/test_nodup_entrance.rb +1 -1
- data/test/node/test_nospam_entrance.rb +1 -1
- data/test/node/test_safe_entrance.rb +1 -1
- data/test/node/test_spread_entrance.rb +1 -1
- data/test/node/test_sync_entrance.rb +1 -1
- data/test/node/test_trace.rb +1 -1
- data/test/test__helper.rb +1 -1
- data/test/test_age.rb +1 -1
- data/test/test_amount.rb +1 -1
- data/test/test_cached_wallets.rb +1 -1
- data/test/test_copies.rb +1 -1
- data/test/test_dir_items.rb +1 -1
- data/test/test_hexnum.rb +1 -1
- data/test/test_http.rb +1 -1
- data/test/test_hungry_wallets.rb +1 -1
- data/test/test_id.rb +1 -1
- data/test/test_json_page.rb +1 -1
- data/test/test_key.rb +1 -1
- data/test/test_log.rb +1 -1
- data/test/test_metronome.rb +1 -1
- data/test/test_patch.rb +1 -1
- data/test/test_prefixes.rb +1 -1
- data/test/test_remotes.rb +2 -2
- data/test/test_signature.rb +1 -1
- data/test/test_size.rb +1 -1
- data/test/test_sync_wallets.rb +1 -1
- data/test/test_tax.rb +1 -1
- data/test/test_thread_pool.rb +1 -1
- data/test/test_tree_wallets.rb +1 -1
- data/test/test_txn.rb +1 -1
- data/test/test_upgrades.rb +1 -1
- data/test/test_verbose_thread.rb +1 -1
- data/test/test_wallet.rb +2 -1
- data/test/test_wallets.rb +1 -1
- data/test/test_zold.rb +1 -1
- data/test/upgrades/test_protocol_up.rb +1 -1
- data/upgrades/2.rb +1 -1
- data/upgrades/move_wallets_into_tree.rb +1 -1
- data/upgrades/protocol_up.rb +1 -1
- data/upgrades/rename_foreign_wallets.rb +1 -1
- data/zold.gemspec +10 -10
- metadata +79 -83
- data/Procfile +0 -1
- data/heroku-run.sh +0 -5
data/lib/zold/dir_items.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -39,7 +39,7 @@ module Zold
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def fetch(recursive: true)
|
42
|
-
`find #{([@dir] + (recursive ? [] : ['-maxdepth', '1']) + ['-type', 'f', '-print']).join(' ')}`
|
42
|
+
`find #{([@dir] + (recursive ? [] : ['-maxdepth', '1']) + ['-type', 'f', '-print']).join(' ')} 2>/dev/null`
|
43
43
|
.strip
|
44
44
|
.split(' ')
|
45
45
|
.select { |f| f.start_with?(@dir) && f.length > @dir.length }
|
data/lib/zold/endless.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/gem.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/head.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/hexnum.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/http.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/hungry_wallets.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/id.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/json_page.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/key.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/log.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/metronome.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/node/emission.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/node/entrance.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/node/farm.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -65,7 +65,7 @@ module Zold
|
|
65
65
|
@invoice = invoice
|
66
66
|
@pipeline = Queue.new
|
67
67
|
@farmer = farmer
|
68
|
-
@threads = ThreadPool.new('farm')
|
68
|
+
@threads = ThreadPool.new('farm', log: log)
|
69
69
|
@lifetime = lifetime
|
70
70
|
@strength = strength
|
71
71
|
end
|
data/lib/zold/node/farmers.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/node/front.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -30,6 +30,7 @@ require 'sinatra/base'
|
|
30
30
|
require 'concurrent'
|
31
31
|
require 'backtrace'
|
32
32
|
require 'zache'
|
33
|
+
require 'total'
|
33
34
|
require_relative '../version'
|
34
35
|
require_relative '../size'
|
35
36
|
require_relative '../wallet'
|
@@ -224,6 +225,7 @@ this is not a normal behavior, you may want to report a bug to our GitHub reposi
|
|
224
225
|
require 'usagewatch_ext'
|
225
226
|
Object.const_defined?('Usagewatch') ? Usagewatch.uw_load.to_f : 0.0
|
226
227
|
end,
|
228
|
+
total_mem: total_mem,
|
227
229
|
threads: "#{Thread.list.select { |t| t.status == 'run' }.count}/#{Thread.list.count}",
|
228
230
|
wallets: total_wallets,
|
229
231
|
remotes: all_remotes.count,
|
@@ -363,6 +365,11 @@ this is not a normal behavior, you may want to report a bug to our GitHub reposi
|
|
363
365
|
)
|
364
366
|
end
|
365
367
|
|
368
|
+
get '/wallets' do
|
369
|
+
content_type('text/plain')
|
370
|
+
settings.wallets.all.map(&:to_s).join('\n')
|
371
|
+
end
|
372
|
+
|
366
373
|
get '/remotes' do
|
367
374
|
content_type('application/json')
|
368
375
|
pretty(
|
@@ -442,6 +449,15 @@ time to stop; use --skip-oom to never quit")
|
|
442
449
|
yield header
|
443
450
|
end
|
444
451
|
|
452
|
+
def total_mem
|
453
|
+
settings.zache.get(:total_mem, lifetime: settings.opts['no-cache'] ? 0 : 60) do
|
454
|
+
Total::Mem.new.bytes
|
455
|
+
rescue Total::CantDetect => e
|
456
|
+
@log.error(e.message)
|
457
|
+
0
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
445
461
|
def total_wallets
|
446
462
|
settings.zache.get(:wallets, lifetime: settings.opts['no-cache'] ? 0 : 60) do
|
447
463
|
settings.wallets.count
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/node/soft_error.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/node/trace.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/patch.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/prefixes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/remotes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/signature.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/size.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -34,8 +34,9 @@ module Zold
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def to_s
|
37
|
-
|
38
|
-
|
37
|
+
if @bytes.nil?
|
38
|
+
'?'
|
39
|
+
elsif @bytes < 1024
|
39
40
|
"#{@bytes}b"
|
40
41
|
elsif @bytes < 1024 * 1024
|
41
42
|
"#{(@bytes / 1024).round}Kb"
|
data/lib/zold/sync_wallets.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/tax.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/thread_pool.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -106,6 +106,7 @@ module Zold
|
|
106
106
|
@threads.each do |t|
|
107
107
|
(t.thread_variable_get(:kids) || []).each(&:kill)
|
108
108
|
t.kill
|
109
|
+
sleep(0.001) while t.alive? # I believe it's a bug in Ruby, this line fixes it
|
109
110
|
Thread.current.thread_variable_set(
|
110
111
|
:kids,
|
111
112
|
(Thread.current.thread_variable_get(:kids) || []) - [t]
|
data/lib/zold/tree_wallets.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/txn.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -55,6 +55,16 @@ module Zold
|
|
55
55
|
|
56
56
|
attr_reader :id, :date, :amount, :prefix, :bnf, :details, :sign
|
57
57
|
attr_writer :sign, :amount, :bnf
|
58
|
+
|
59
|
+
# Make a new object of this class (you must read the White Paper
|
60
|
+
# in order to understand this class).
|
61
|
+
#
|
62
|
+
# +id+:: is the ID of the transaction, an integer
|
63
|
+
# +date+:: is the date/time of the transaction
|
64
|
+
# +amount+:: is the amount, an instance of class +Amount+
|
65
|
+
# +prefix+:: is the prefix from the Invoice (read the WP)
|
66
|
+
# +bnf+:: is the wallet ID of the paying or receiving wallet
|
67
|
+
# +details+:: is the details, in plain text
|
58
68
|
def initialize(id, date, amount, prefix, bnf, details)
|
59
69
|
raise 'The ID can\'t be NIL' if id.nil?
|
60
70
|
raise "ID of transaction can't be negative: #{id}" if id < 1
|
data/lib/zold/txns.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/upgrades.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/verbose_thread.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zold/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018
|
3
|
+
# Copyright (c) 2018-2019 Zerocracy, Inc.
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -25,7 +25,7 @@
|
|
25
25
|
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
26
26
|
# License:: MIT
|
27
27
|
module Zold
|
28
|
-
VERSION = '0.21.
|
28
|
+
VERSION = '0.21.2'
|
29
29
|
PROTOCOL = 2
|
30
30
|
REPO = 'zold-io/zold'
|
31
31
|
end
|