zold 0.9 → 0.9.1
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/README.md +13 -13
- data/lib/zold/commands/push.rb +1 -0
- data/lib/zold/node/emission.rb +1 -1
- data/lib/zold/version.rb +1 -1
- data/test/fake_home.rb +1 -2
- data/test/node/test_emission.rb +14 -0
- data/wp/wp.tex +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0965f33c8cc7524f35fbad8f3c6b71698329d3b
|
4
|
+
data.tar.gz: 5b7dd211d078e0f7b09e488d875d134254db4444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73ca9c46b4ca0bd313aae92ab305e2eeeb0859f5dc3b77ff389e3c13aad620338e1f01638b2cdc3e112e0e72d4c4aee4ee45ac8b8a27b3e0cb7d8a274925cea8
|
7
|
+
data.tar.gz: e6f376c108532890f2cb7e1053c0a3945a1ae47b197ab3a99e791749a892947aa03cc1abf6c47cb1c6b79a5480ec2268f073a5ccf8306a2a5ddfabe051fbad7f
|
data/README.md
CHANGED
@@ -5,17 +5,17 @@
|
|
5
5
|
[](http://www.rultor.com/p/yegor256/Zold)
|
6
6
|
[](https://www.jetbrains.com/ruby/)
|
7
7
|
|
8
|
-
[](https://travis-ci.org/zerocracy/zold)
|
9
9
|
[](https://ci.appveyor.com/project/yegor256/zold)
|
10
10
|
[](http://www.0pdd.com/p?name=yegor256/zold)
|
11
11
|
[](http://badge.fury.io/rb/zold)
|
12
|
-
[](https://codecov.io/github/zerocracy/zold?branch=master)
|
13
13
|
|
14
14
|
[](https://gemnasium.com/yegor256/zold)
|
15
15
|
[](https://codeclimate.com/github/yegor256/zold/maintainability)
|
16
16
|
|
17
17
|
**NOTICE**: It's an experiment and a very early draft! Please, feel free to
|
18
|
-
submit your ideas or pull requests.
|
18
|
+
submit your ideas and/or pull requests.
|
19
19
|
|
20
20
|
Here is the [White Paper](https://github.com/yegor256/zold/raw/master/wp/wp.pdf).
|
21
21
|
|
@@ -30,13 +30,7 @@ $ sudo apt-get install ruby-dev rubygems zlib1g-dev
|
|
30
30
|
$ gem install zold
|
31
31
|
```
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
```bash
|
36
|
-
$ zold node
|
37
|
-
```
|
38
|
-
|
39
|
-
For more options and commands just run:
|
33
|
+
For more options and commands you can always use this:
|
40
34
|
|
41
35
|
```bash
|
42
36
|
$ zold --help
|
@@ -91,8 +85,8 @@ In order to do that just run:
|
|
91
85
|
$ zold node --invoice=5f96e731e48ae21f
|
92
86
|
```
|
93
87
|
|
94
|
-
Grateful users of the system will pay "taxes" to your wallet
|
95
|
-
of their
|
88
|
+
Grateful users of the system will pay "taxes" to your wallet
|
89
|
+
for the maintenance of their wallets.
|
96
90
|
|
97
91
|
## How to Contribute
|
98
92
|
|
@@ -118,5 +112,11 @@ check the logging configuration inside `test__helper.rb` and make
|
|
118
112
|
sure the `Verbose` log is assigned to `$log`. Then, run, for example:
|
119
113
|
|
120
114
|
```bash
|
121
|
-
ruby test/commands/test_node.rb
|
115
|
+
$ ruby test/commands/test_node.rb
|
116
|
+
```
|
117
|
+
|
118
|
+
If you need to run a single test method, do this:
|
119
|
+
|
120
|
+
```bash
|
121
|
+
$ ruby test/test_wallet.rb -n test_adds_transaction
|
122
122
|
```
|
data/lib/zold/commands/push.rb
CHANGED
@@ -66,6 +66,7 @@ Available options:"
|
|
66
66
|
unless response.code == '200'
|
67
67
|
@remotes.error(r[:host], r[:port])
|
68
68
|
@log.error("#{uri} failed as #{response.code}/#{response.message}")
|
69
|
+
@log.debug(response.body) unless response.body.empty?
|
69
70
|
next
|
70
71
|
end
|
71
72
|
json = JSON.parse(response.body)['score']
|
data/lib/zold/node/emission.rb
CHANGED
data/lib/zold/version.rb
CHANGED
data/test/fake_home.rb
CHANGED
@@ -42,8 +42,7 @@ class FakeHome
|
|
42
42
|
Zold::Wallets.new(@dir)
|
43
43
|
end
|
44
44
|
|
45
|
-
def create_wallet
|
46
|
-
id = Zold::Id.new
|
45
|
+
def create_wallet(id = Zold::Id.new)
|
47
46
|
wallet = Zold::Wallet.new(File.join(@dir, id.to_s))
|
48
47
|
wallet.init(id, Zold::Key.new(file: 'fixtures/id_rsa.pub'))
|
49
48
|
wallet
|
data/test/node/test_emission.rb
CHANGED
@@ -41,4 +41,18 @@ Limit: #{Zold::Emission.new(wallet).limit}")
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
def test_emission_passes
|
46
|
+
FakeHome.new.run do |home|
|
47
|
+
wallet = home.create_wallet(Zold::Id::ROOT)
|
48
|
+
wallet.add(
|
49
|
+
Zold::Txn.new(
|
50
|
+
1, Time.now - 60 * 24,
|
51
|
+
Zold::Amount.new(zld: 10.99),
|
52
|
+
'NOPREFIX', Zold::Id.new, '-'
|
53
|
+
)
|
54
|
+
)
|
55
|
+
Zold::Emission.new(wallet).check
|
56
|
+
end
|
57
|
+
end
|
44
58
|
end
|
data/wp/wp.tex
CHANGED
@@ -703,6 +703,16 @@ This scenario is indeed possible, but it is assumed that since tax payments are
|
|
703
703
|
supposed to be made in small increments and automatically, the majority of
|
704
704
|
clients won't be interested in this fraudulent scheme.
|
705
705
|
|
706
|
+
\subsection{Loss of Wallet}
|
707
|
+
|
708
|
+
A wallet is just a text file, which can easily be lost by it owner.
|
709
|
+
|
710
|
+
This indeed is possible, but is not a risk at all, since all wallets are
|
711
|
+
maintained by the network and anyone can easily pull any wallet back.
|
712
|
+
The only sensitive part is the private key of the wallet. If that file
|
713
|
+
is lost, the wallet can't pay anything anymore. This is the file all
|
714
|
+
wallet owners must keep safe.
|
715
|
+
|
706
716
|
\printbibliography%
|
707
717
|
|
708
718
|
\end{document}
|