zold 0.31.7 → 0.31.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/zold/commands/create.rb +1 -0
- data/lib/zold/id.rb +2 -1
- data/lib/zold/version.rb +1 -1
- data/test/test_id.rb +9 -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: 9abfe10e54589d7b6e68c781a8ca1c19a5e5af9a10a406220d48780c96fe1652
|
4
|
+
data.tar.gz: 7e88c3b44790c5790f67e8acc4e692c7d238dd4b075aa105776eacd1eb98b74e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f44872c5be6317323925cefdeac512204e6c419427159d366bc823954170136cb130cda39624677d21508fc5979a0b7056bfc5316f1db4873752a41b33209c8d
|
7
|
+
data.tar.gz: d4a83f7d531690bc63eca6df99283a3aed0eaf9b9e660f0d4b4b1824805763868a413cd9c147447b80358d56de0ab6de95febf6dcba596b73da432ee1bd842a1
|
data/.rubocop.yml
CHANGED
data/lib/zold/commands/create.rb
CHANGED
@@ -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 (yegor256@gmail.com)
|
@@ -38,7 +39,7 @@ module Zold
|
|
38
39
|
|
39
40
|
def self.generate_id
|
40
41
|
loop do
|
41
|
-
id =
|
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
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.
|
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-
|
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.
|
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
|