zold 0.31.7 → 0.31.8

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: 26fe6d1488ddc6057bfd7f111e4416c0f7b5be3fdd666cb35fbdad266f8b3781
4
- data.tar.gz: 84dc64cb04a530b5d37ce47a84f703f7e7e44020a5ef5051ddbdd8780a8123b6
3
+ metadata.gz: 9abfe10e54589d7b6e68c781a8ca1c19a5e5af9a10a406220d48780c96fe1652
4
+ data.tar.gz: 7e88c3b44790c5790f67e8acc4e692c7d238dd4b075aa105776eacd1eb98b74e
5
5
  SHA512:
6
- metadata.gz: 30cb9a25a68e21b85c71c774cf576361c22c56e5656a2c8ce6a8c0f6b3afc6596712508fd53d4afebe9f998a712900fc3a5cec2e0dd11de9c55c5fea21a41969
7
- data.tar.gz: 785eb36d46618757844dc23a86288e1e3944b1f8175007ee801a5f45846e615d489cf516f99a78c29b03d34a93c89aa6cda5984ee075d11dbbdb178d543948ec
6
+ metadata.gz: f44872c5be6317323925cefdeac512204e6c419427159d366bc823954170136cb130cda39624677d21508fc5979a0b7056bfc5316f1db4873752a41b33209c8d
7
+ data.tar.gz: d4a83f7d531690bc63eca6df99283a3aed0eaf9b9e660f0d4b4b1824805763868a413cd9c147447b80358d56de0ab6de95febf6dcba596b73da432ee1bd842a1
data/.rubocop.yml CHANGED
@@ -39,7 +39,7 @@ Layout/ParameterAlignment:
39
39
  Enabled: false
40
40
  Metrics/PerceivedComplexity:
41
41
  Max: 45
42
- Metrics/LineLength:
42
+ Layout/LineLength:
43
43
  Max: 120
44
44
  Style/MultilineBlockChain:
45
45
  Enabled: false
@@ -87,6 +87,7 @@ Available options:"
87
87
  def create(id, opts)
88
88
  key = Zold::Key.new(file: opts['public-key'])
89
89
  @wallets.acq(id, exclusive: true) do |wallet|
90
+ raise "Wallet #{id} already exists" if wallet.exists?
90
91
  wallet.init(id, key, network: opts['network'])
91
92
  @log.debug("Wallet #{Rainbow(wallet).green} created at #{@wallets.path}")
92
93
  end
data/lib/zold/id.rb CHANGED
@@ -21,6 +21,7 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  require 'csv'
24
+ require 'securerandom'
24
25
 
25
26
  # The ID of the wallet.
26
27
  # Author:: Yegor Bugayenko ([email protected])
@@ -38,7 +39,7 @@ module Zold
38
39
 
39
40
  def self.generate_id
40
41
  loop do
41
- id = format('%016x', rand((2**32)..(2**64) - 1))
42
+ id = SecureRandom.hex(8)
42
43
  next if Id::BANNED.include?(id)
43
44
  return id
44
45
  end
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.7'
28
+ VERSION = '0.31.8'
29
29
  PROTOCOL = 2
30
30
  REPO = 'zold-io/zold'
31
31
  end
data/test/test_id.rb CHANGED
@@ -37,6 +37,15 @@ class TestId < Zold::Test
37
37
  end
38
38
  end
39
39
 
40
+ def test_generates_different_ids
41
+ before = ''
42
+ 500.times do
43
+ id = Zold::Id.new
44
+ assert id.to_s != before.to_s
45
+ before = id
46
+ end
47
+ end
48
+
40
49
  def test_list_of_banned_ids_is_not_empty
41
50
  assert(!Zold::Id::BANNED.empty?)
42
51
  end
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.31.7
4
+ version: 0.31.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-01 00:00:00.000000000 Z
11
+ date: 2023-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace
@@ -597,7 +597,7 @@ licenses:
597
597
  - MIT
598
598
  metadata: {}
599
599
  post_install_message: |-
600
- Thanks for installing Zold 0.31.7!
600
+ Thanks for installing Zold 0.31.8!
601
601
  Study our White Paper: https://papers.zold.io/wp.pdf
602
602
  Read our blog posts: https://blog.zold.io
603
603
  Try ZLD online wallet at: https://wts.zold.io
OSZAR »