zold 0.9 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c679c519c561ea8522e9bddbf1607b376a27088f
4
- data.tar.gz: acddc029d1978dd0ba26e8091d56a59a05a3b670
3
+ metadata.gz: b0965f33c8cc7524f35fbad8f3c6b71698329d3b
4
+ data.tar.gz: 5b7dd211d078e0f7b09e488d875d134254db4444
5
5
  SHA512:
6
- metadata.gz: ba1472c49c84588d567e727e1dc364c474715cd9c6914e4f67e42a1addad4462efcd5e723362dddb2c20cf42027591ca15014d05ad9e838ce0a84816f92c49b6
7
- data.tar.gz: c6ca405a5f4c99737b6b19836bb141c1b9d8604c355375c40493b2ff8c7d7c1f864e4dab8eb5bc326f6871157c1a73426287e00135ba6e8d48ad160e354df02c
6
+ metadata.gz: 73ca9c46b4ca0bd313aae92ab305e2eeeb0859f5dc3b77ff389e3c13aad620338e1f01638b2cdc3e112e0e72d4c4aee4ee45ac8b8a27b3e0cb7d8a274925cea8
7
+ data.tar.gz: e6f376c108532890f2cb7e1053c0a3945a1ae47b197ab3a99e791749a892947aa03cc1abf6c47cb1c6b79a5480ec2268f073a5ccf8306a2a5ddfabe051fbad7f
data/README.md CHANGED
@@ -5,17 +5,17 @@
5
5
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/Zold)](http://www.rultor.com/p/yegor256/Zold)
6
6
  [![We recommend RubyMine](http://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
7
7
 
8
- [![Build Status](https://travis-ci.org/yegor256/zold.svg)](https://travis-ci.org/yegor256/zold)
8
+ [![Build Status](https://travis-ci.org/zerocracy/zold.svg)](https://travis-ci.org/zerocracy/zold)
9
9
  [![Build status](https://ci.appveyor.com/api/projects/status/ypctxm5ohrtp2kr4?svg=true)](https://ci.appveyor.com/project/yegor256/zold)
10
10
  [![PDD status](http://www.0pdd.com/svg?name=yegor256/zold)](http://www.0pdd.com/p?name=yegor256/zold)
11
11
  [![Gem Version](https://badge.fury.io/rb/zold.svg)](http://badge.fury.io/rb/zold)
12
- [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/zold.svg)](https://codecov.io/github/yegor256/zold?branch=master)
12
+ [![Test Coverage](https://img.shields.io/codecov/c/github/zerocracy/zold.svg)](https://codecov.io/github/zerocracy/zold?branch=master)
13
13
 
14
14
  [![Dependency Status](https://gemnasium.com/yegor256/zold.svg)](https://gemnasium.com/yegor256/zold)
15
15
  [![Maintainability](https://api.codeclimate.com/v1/badges/7489c1d2bacde40ffc09/maintainability)](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
- Then, either run it as a node:
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 for processing
95
- of their transactions.
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
  ```
@@ -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']
@@ -51,7 +51,7 @@ module Zold
51
51
 
52
52
  def check
53
53
  return unless @root.root?
54
- allowed = limit
54
+ allowed = limit * -1
55
55
  balance = @root.balance
56
56
  raise "The balance #{balance} of the root wallet is too low (max allowed: #{allowed})" if balance < allowed
57
57
  end
data/lib/zold/version.rb CHANGED
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.9'.freeze
26
+ VERSION = '0.9.1'.freeze
27
27
  end
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
@@ -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}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.9'
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko