nano_rpc 0.15.0 → 0.16.0

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: 384dfb2767f15ba663867d79e98d771de4743b29650acf636f8dbb05ca13712b
4
- data.tar.gz: b98fb36169c35288da75d2da4902f79d275ae9a88197ba746281baa9bfa7c6ad
3
+ metadata.gz: '00840f9e543bcf5bf0aa1d1e80eab75f8eca85d57f563433e0e1953b7c2e21bd'
4
+ data.tar.gz: 1755874a4ad420ab7cb18ddd9fe75a6f64332a194b91694a2a91ed0ca7852ba0
5
5
  SHA512:
6
- metadata.gz: d39b16abbafe3347448eca3341dcc98918149e6df0724078c2e45fdb444f4a352620b50ec2de0d8f4f40a6fa70448a5e520c6299599024fc9908ff90aede288b
7
- data.tar.gz: 166a68643c927e662cf33372882e3978135e3ab17a9e5a276eb52e3340754f7e9414cda652b507988c6a66a6d4853737e7a5ffceb332ccdd3fb9015e254d9ba7
6
+ metadata.gz: 6d4d582586ce0edcac28a3f8225cca86ac121aaddd46a9f8fc568caee3e45a2ce4b14a2846f977a9ac33d7732c454d3f66df3272f1fdabe69fe17fa3a77ff328
7
+ data.tar.gz: 72a84f3052b62754cbede4be1cca2e82f708c0ed9eac085dbba8a53f1dee86f69ac46d26c62bc02cc5f2ad836e2f27169526816e17f6efcda69f929cffec47fd
data/README.md CHANGED
@@ -41,12 +41,12 @@ Proxy objects are provided to ease interaction with the API by providing logical
41
41
  * [NanoRpc::Node](https://github.com/jcraigk/ruby_nano_rpc/wiki/NanoRpc::Node)
42
42
  * [NanoRpc::Wallet](https://github.com/jcraigk/ruby_nano_rpc/wiki/NanoRpc::Wallet)
43
43
 
44
- `Account`, `Accounts`, and `Wallet` each require a single parameter to be passed during initialization (`address`, `addresses`, and `seed`, respectively). This parameter is persisted for subsequent calls. All RPC methods are provided directly as methods.
44
+ `Account`, `Accounts`, and `Wallet` each require a single parameter to be passed during initialization (`address`, `addresses`, and `id`, respectively). This parameter is persisted for subsequent calls. All RPC methods are provided directly as methods.
45
45
 
46
46
  ```ruby
47
47
  account = NanoRpc.node.account('xrb_1234') # Account address required
48
48
  accounts = NanoRpc.node.accounts(%w[xrb_1234 xrb_456]) # Array of account addresses required
49
- wallet = NanoRpc.node.wallet('3AF91AE') # Wallet seed required
49
+ wallet = NanoRpc.node.wallet('3AF91AE') # Wallet id required
50
50
  ```
51
51
 
52
52
  You can call standard RPC methods on each object:
@@ -54,8 +54,8 @@ module NanoRpc::NodeHelper
54
54
  available_supply.available
55
55
  end
56
56
 
57
- def wallet(seed)
58
- NanoRpc::Wallet.new(seed, node: self)
57
+ def wallet(id)
58
+ NanoRpc::Wallet.new(id, node: self)
59
59
  end
60
60
 
61
61
  def work_valid?(work:, hash:)
@@ -87,7 +87,7 @@ module NanoRpc::WalletHelper
87
87
  end
88
88
 
89
89
  def move_accounts(to:, accounts:)
90
- account_move(wallet: to, source: seed, accounts: accounts).moved == 1
90
+ account_move(wallet: to, source: id, accounts: accounts).moved == 1
91
91
  end
92
92
 
93
93
  def password_valid?(password:)
data/lib/nano_rpc/node.rb CHANGED
@@ -133,7 +133,7 @@ class NanoRpc::Node
133
133
 
134
134
  def proxy_method(obj)
135
135
  if obj.is_a?(NanoRpc::Wallet)
136
- :seed
136
+ :id
137
137
  elsif obj.is_a?(NanoRpc::Accounts)
138
138
  :addresses
139
139
  elsif obj.is_a?(NanoRpc::Account)
@@ -3,24 +3,19 @@ class NanoRpc::Wallet
3
3
  include NanoRpc::Proxy
4
4
  include NanoRpc::WalletHelper
5
5
 
6
- attr_reader :seed
6
+ attr_reader :id
7
7
 
8
- def initialize(seed = nil, opts = {})
9
- unless seed.is_a?(String)
8
+ def initialize(id = nil, opts = {})
9
+ unless id.is_a?(String)
10
10
  raise NanoRpc::MissingParameters,
11
- 'Missing argument: seed (str)'
11
+ 'Missing argument: id (str)'
12
12
  end
13
13
 
14
- @seed = seed
14
+ @id = id
15
15
  super(opts)
16
16
  end
17
17
 
18
- # Hide secret seed on object inspection
19
- def inspect
20
- "#{inspect_prefix}, @node=#{@node.inspect}>"
21
- end
22
-
23
- proxy_params wallet: :seed
18
+ proxy_params wallet: :id
24
19
 
25
20
  proxy_method :account_create, optional: %i[work]
26
21
  proxy_method :accounts_create, required: %i[count], optional: %i[work]
@@ -45,14 +45,9 @@ module NanoRpc::Proxy
45
45
 
46
46
  def execute_call
47
47
  result = node.call(@meth, @call_args)
48
- handle_special_methods
49
48
  expose_nested_data(result)
50
49
  end
51
50
 
52
- def handle_special_methods
53
- @seed = @call_args[:seed] if @meth == :wallet_change_seed
54
- end
55
-
56
51
  def base_params
57
52
  @base_params ||= begin
58
53
  return if self.class.proxy_param_def.nil?
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module NanoRpc
3
- VERSION = '0.15.0'
3
+ VERSION = '0.16.0'
4
4
  end
data/nano_rpc.gemspec CHANGED
@@ -23,12 +23,12 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = %w[lib]
25
25
 
26
- spec.add_development_dependency 'bundler', '~> 1.16.1'
26
+ spec.add_development_dependency 'bundler', '~> 1.16.3'
27
27
  spec.add_development_dependency 'codecov', '~> 0.1.10'
28
28
  spec.add_development_dependency 'pry', '~> 0.11.3'
29
29
  spec.add_development_dependency 'rake', '~> 12.3.1'
30
30
  spec.add_development_dependency 'rspec', '~> 3.7.0'
31
- spec.add_development_dependency 'rubocop', '~> 0.56.0'
31
+ spec.add_development_dependency 'rubocop', '~> 0.58.2'
32
32
  spec.add_development_dependency 'simplecov', '~> 0.16.1'
33
33
 
34
34
  spec.add_runtime_dependency 'hashie', '~> 3.5', '>= 3.5.7'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nano_rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Craig-Kuhn (JCK)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-16 00:00:00.000000000 Z
11
+ date: 2018-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.16.1
19
+ version: 1.16.3
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.16.1
26
+ version: 1.16.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: codecov
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.56.0
89
+ version: 0.58.2
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.56.0
96
+ version: 0.58.2
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  requirements: []
203
203
  rubyforge_project:
204
- rubygems_version: 2.7.6
204
+ rubygems_version: 2.7.7
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: RPC wrapper for Nano digital nodes written in Ruby