nanocurrency 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.gitlab-ci.yml +31 -0
- data/Gemfile.lock +1 -1
- data/README.md +5 -3
- data/lib/nano/block.rb +22 -7
- data/lib/nanocurrency/version.rb +1 -1
- data/nanocurrency.gemspec +5 -3
- metadata +11 -10
- data/lib/nanocurrency_ext.bundle +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e67eabc7dbd72b7175424233ffebea1cf7ded01d0428dd7db50dceee5f4ed3c
|
4
|
+
data.tar.gz: c9b73d2bfa21bd930083671e6212cae5ce9d32a3bf674b0b0ac6ac41951d0886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a65e4e4cacf6500c1413079670dcbbfcd4aca85ea73744bca2af7843fac2495f7ff4cc981a81c0b4e5ada4823d85a805f1ba32b21ab55ae39088202293add0f7
|
7
|
+
data.tar.gz: 5445d22476c2f46f0b3b7d8545e89b90f420d0522c7bb01fefa5f4ed51c4441c3dccafae348f16ff1b40111d7434a4da69c4eb2b9fb4b4ed3365fae3b8a40e7c
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
image: ruby:2.5
|
2
|
+
|
3
|
+
stages:
|
4
|
+
- test
|
5
|
+
- deploy
|
6
|
+
|
7
|
+
before_script:
|
8
|
+
- gem install bundler:1.16.6
|
9
|
+
- bundler update
|
10
|
+
|
11
|
+
test:unit:
|
12
|
+
stage: test
|
13
|
+
script:
|
14
|
+
- bundle exec rake full
|
15
|
+
|
16
|
+
test:tag:
|
17
|
+
stage: test
|
18
|
+
only:
|
19
|
+
- tags
|
20
|
+
script:
|
21
|
+
- GEM_RELEASE_VERSION=$CI_COMMIT_TAG ruby test/version.rb
|
22
|
+
|
23
|
+
deploy:rubygems:
|
24
|
+
stage: deploy
|
25
|
+
only:
|
26
|
+
- tags
|
27
|
+
script:
|
28
|
+
- "echo '---\n:rubygems_api_key: '$RUBYGEMS_API_KEY > ~/.gem/credentials"
|
29
|
+
- chmod 0600 ~/.gem/credentials
|
30
|
+
- gem build nanocurrency
|
31
|
+
- gem push nanocurrency-$CI_COMMIT_TAG.gem
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Nanocurrency
|
2
2
|
|
3
|
-
|
3
|
+
A Ruby toolkit and library for the Nano cryptocurrency
|
4
4
|
|
5
|
-
|
5
|
+
To view documentation:
|
6
|
+
|
7
|
+
https://www.rubydoc.info/gems/nanocurrency
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -22,7 +24,7 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
27
|
+
documentation here: https://www.rubydoc.info/gems/nanocurrency
|
26
28
|
|
27
29
|
## Development
|
28
30
|
|
data/lib/nano/block.rb
CHANGED
@@ -2,6 +2,7 @@ require_relative "./hash"
|
|
2
2
|
require_relative "./work"
|
3
3
|
require_relative "./check"
|
4
4
|
require "nanocurrency_ext"
|
5
|
+
require "json"
|
5
6
|
|
6
7
|
module Nano
|
7
8
|
##
|
@@ -36,13 +37,13 @@ module Nano
|
|
36
37
|
|
37
38
|
##
|
38
39
|
# The block initializer, requires certain parameters to be valid.
|
39
|
-
# @param params [Hash] The block parameters to construct the block with
|
40
|
-
# `:previous` - The previous block hash as a string
|
41
|
-
# `:account` - The associated account address as a string
|
42
|
-
# `:representative` - The account representative as a string
|
43
|
-
# `:balance` - The account balance after this block in raw unit
|
44
|
-
# `:link` - The link hash associated with this block
|
45
|
-
# `:work` - The proof of work for the block (optional)
|
40
|
+
# @param params [Hash] The block parameters to construct the block with.\n
|
41
|
+
# `:previous` - The previous block hash as a string\n
|
42
|
+
# `:account` - The associated account address as a string\n
|
43
|
+
# `:representative` - The account representative as a string\n
|
44
|
+
# `:balance` - The account balance after this block in raw unit\n
|
45
|
+
# `:link` - The link hash associated with this block.\n
|
46
|
+
# `:work` - The proof of work for the block (optional)\n
|
46
47
|
# `:signature` - The signature for this block (optional)
|
47
48
|
def initialize(params)
|
48
49
|
@type = "state"
|
@@ -138,5 +139,19 @@ module Nano
|
|
138
139
|
def hash
|
139
140
|
Nano::Hash.hash_block(self)
|
140
141
|
end
|
142
|
+
|
143
|
+
def to_json(options = nil)
|
144
|
+
{
|
145
|
+
type: type,
|
146
|
+
account: account,
|
147
|
+
previous: previous,
|
148
|
+
representative: representative,
|
149
|
+
balance: balance,
|
150
|
+
link: link,
|
151
|
+
link_as_account: link_as_account,
|
152
|
+
signature: signature,
|
153
|
+
work: work
|
154
|
+
}.to_json(options)
|
155
|
+
end
|
141
156
|
end
|
142
157
|
end
|
data/lib/nanocurrency/version.rb
CHANGED
data/nanocurrency.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = "A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks."
|
12
12
|
spec.description = "A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks."
|
13
|
-
spec.homepage = "https://
|
13
|
+
spec.homepage = "https://gitlab.com/Nanotify/ruby/nanocurrency"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
20
20
|
|
21
21
|
spec.metadata["homepage_uri"] = spec.homepage
|
22
|
-
spec.metadata["source_code_uri"] = "https://
|
23
|
-
spec.metadata["changelog_uri"] = "https://
|
22
|
+
spec.metadata["source_code_uri"] = "https://gitlab.com/Nanotify/ruby/nanocurrency"
|
23
|
+
spec.metadata["changelog_uri"] = "https://gitlab.com/Nanotify/ruby/nanocurrency"
|
24
|
+
spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/nanocurrency"
|
24
25
|
else
|
25
26
|
raise "RubyGems 2.0 or newer is required to protect against " \
|
26
27
|
"public gem pushes."
|
@@ -34,6 +35,7 @@ Gem::Specification.new do |spec|
|
|
34
35
|
spec.bindir = "exe"
|
35
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
37
|
spec.require_paths = ["lib"]
|
38
|
+
spec.extensions = %w[ext/nanocurrency_ext/extconf.rb]
|
37
39
|
|
38
40
|
spec.add_dependency "blake2b"
|
39
41
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanocurrency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliott Minns
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blake2b
|
@@ -85,10 +85,12 @@ description: A toolkit for the Nano cryptocurrency, allowing you to derive keys,
|
|
85
85
|
email:
|
86
86
|
- elliott@nanotify.io
|
87
87
|
executables: []
|
88
|
-
extensions:
|
88
|
+
extensions:
|
89
|
+
- ext/nanocurrency_ext/extconf.rb
|
89
90
|
extra_rdoc_files: []
|
90
91
|
files:
|
91
92
|
- ".gitignore"
|
93
|
+
- ".gitlab-ci.yml"
|
92
94
|
- ".rspec"
|
93
95
|
- ".travis.yml"
|
94
96
|
- CODE_OF_CONDUCT.md
|
@@ -158,16 +160,16 @@ files:
|
|
158
160
|
- lib/nano/work.rb
|
159
161
|
- lib/nanocurrency.rb
|
160
162
|
- lib/nanocurrency/version.rb
|
161
|
-
- lib/nanocurrency_ext.bundle
|
162
163
|
- nanocurrency.gemspec
|
163
|
-
homepage: https://
|
164
|
+
homepage: https://gitlab.com/Nanotify/ruby/nanocurrency
|
164
165
|
licenses:
|
165
166
|
- MIT
|
166
167
|
metadata:
|
167
168
|
allowed_push_host: https://rubygems.org
|
168
|
-
homepage_uri: https://
|
169
|
-
source_code_uri: https://
|
170
|
-
changelog_uri: https://
|
169
|
+
homepage_uri: https://gitlab.com/Nanotify/ruby/nanocurrency
|
170
|
+
source_code_uri: https://gitlab.com/Nanotify/ruby/nanocurrency
|
171
|
+
changelog_uri: https://gitlab.com/Nanotify/ruby/nanocurrency
|
172
|
+
documentation_uri: https://www.rubydoc.info/gems/nanocurrency
|
171
173
|
post_install_message:
|
172
174
|
rdoc_options: []
|
173
175
|
require_paths:
|
@@ -183,8 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
185
|
- !ruby/object:Gem::Version
|
184
186
|
version: '0'
|
185
187
|
requirements: []
|
186
|
-
|
187
|
-
rubygems_version: 2.7.9
|
188
|
+
rubygems_version: 3.0.3
|
188
189
|
signing_key:
|
189
190
|
specification_version: 4
|
190
191
|
summary: A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate
|
data/lib/nanocurrency_ext.bundle
DELETED
Binary file
|