openassets-ruby 0.6.7 → 0.7.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
- SHA1:
3
- metadata.gz: 762cb76ac06beeb46aac132bcb5ac714edf67976
4
- data.tar.gz: 421ce1356c464b70c927b37cf79297b9383329d8
2
+ SHA256:
3
+ metadata.gz: 1cd6a9bb5787981c5b6fa09927547fa27d480122398a728f29b26d5cc3dc38ef
4
+ data.tar.gz: fa92fb3ab5bd0a9616959b57e181c5de92f4b48c4845ded4dd0345ddb5c1bae7
5
5
  SHA512:
6
- metadata.gz: f2d91da9ed7a58efe8eb8139a0e3779fccf6c5c721fd762f901cfe512abb82bdf6cf1558905836c4ee1a012b7833461beba9cab41afb54a35106cde5fccec2dc
7
- data.tar.gz: 23df64ea454a114ca8f2bbd6d3bd851f716db29008c03166e108b940cdd74efecf32b2aa803756cf6a29adfca572d5e465bc55b9cebf1b7c0cc14883d1fd642a
6
+ metadata.gz: d8b73b6586b9254b832df6dc413345a72cdf8e41aa25e366464e5c2a5605303302b6ae8efdd9c42d9a5a967d1d6999cb8900f318b687b7f2ee9ef51309ef48fc
7
+ data.tar.gz: d1f16659ad557210e360f37f3a439521ed77d8fa5cdf2ad94c9f7f477b886dc694a60207b3e5e5982e39aea9ad1f1f6ebb5b72d4f42cbbbc46e750e729a3c689
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.6.3
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.5.0
4
- - 2.4.1
5
- - 2.4.0
3
+ - 2.6.3
4
+ - 2.5.5
5
+ - 2.4.5
6
6
  - 2.3.0
7
7
 
8
8
  bundler_args: --jobs=2
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # openassets-ruby [![Build Status](https://travis-ci.org/haw-itn/openassets-ruby.svg?branch=master)](https://travis-ci.org/haw-itn/openassets-ruby) [![Gem Version](https://badge.fury.io/rb/openassets-ruby.svg)](https://badge.fury.io/rb/openassets-ruby) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
1
+ # openassets-ruby [![Build Status](https://travis-ci.org/haw/openassets-ruby.svg?branch=master)](https://travis-ci.org/haw/openassets-ruby) [![Gem Version](https://badge.fury.io/rb/openassets-ruby.svg)](https://badge.fury.io/rb/openassets-ruby) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
2
2
  The implementation of the [Open Assets Protocol](https://github.com/OpenAssets/open-assets-protocol) for Ruby.
3
3
 
4
4
  ## Install
5
5
 
6
- ```ruby
6
+ ```rubyThe implementation of the bitcoin protocol for ruby.
7
7
  gem install openassets-ruby
8
8
  ```
9
9
 
@@ -219,7 +219,6 @@ module OpenAssets
219
219
  cached = output_cache.get(txid, output_index)
220
220
  return cached unless cached.nil?
221
221
  end
222
- puts "#{txid}:[#{output_index}]"
223
222
  decode_tx = load_cached_tx(txid)
224
223
  tx = Bitcoin::Protocol::Tx.new(decode_tx.htb)
225
224
  colored_outputs = get_color_outputs_from_tx(tx)
@@ -228,7 +227,7 @@ module OpenAssets
228
227
  end
229
228
 
230
229
  def get_color_outputs_from_tx(tx)
231
- unless tx.is_coinbase?
230
+ unless tx.coinbase?
232
231
  tx.outputs.each_with_index { |out, i|
233
232
  marker_output_payload = OpenAssets::Protocol::MarkerOutput.parse_script(out.pk_script)
234
233
  unless marker_output_payload.nil?
@@ -50,7 +50,7 @@ module OpenAssets
50
50
  # @param [String] tx The serialized format transaction.
51
51
  # @return [Bitcoin::Protocol::Tx] The signed transaction.
52
52
  def sign_transaction(tx)
53
- signed_tx = signrawtransaction(tx)
53
+ signed_tx = respond_to?(:signrawtransactionwithwallet) ? signrawtransactionwithwallet(tx) : signrawtransaction(tx)
54
54
  raise OpenAssets::Error, 'Could not sign the transaction.' unless signed_tx['complete']
55
55
  Bitcoin::Protocol::Tx.new(signed_tx['hex'].htb)
56
56
  end
@@ -68,7 +68,6 @@ module OpenAssets
68
68
  importaddress(address)
69
69
  end
70
70
 
71
- private
72
71
  # Convert decode tx string to Bitcion::Protocol::Tx
73
72
  def decode_tx_to_btc_tx(tx)
74
73
  hash = {
@@ -90,22 +89,11 @@ module OpenAssets
90
89
  Bitcoin::Protocol::Tx.from_hash(hash)
91
90
  end
92
91
 
93
- private
94
- def server_url
95
- url = "#{@config[:schema]}://"
96
- url.concat "#{@config[:user]}:#{@config[:password]}@"
97
- url.concat "#{@config[:host]}:#{@config[:port]}"
98
- if !@config[:wallet].nil? && !@config[:wallet].empty?
99
- url.concat "/wallet/#{@config[:wallet]}"
100
- end
101
- url
102
- end
103
-
104
92
  def request(command, *params)
105
93
  data = {
106
- :method => command,
107
- :params => params,
108
- :id => 'jsonrpc'
94
+ :method => command,
95
+ :params => params,
96
+ :id => 'jsonrpc'
109
97
  }
110
98
  post(server_url, @config[:timeout], @config[:open_timeout], data.to_json, content_type: :json) do |respdata, request, result|
111
99
  raise ApiError, result.message if !result.kind_of?(Net::HTTPSuccess) && respdata.empty?
@@ -115,9 +103,22 @@ module OpenAssets
115
103
  end
116
104
  end
117
105
 
106
+ private
107
+
108
+ def server_url
109
+ url = "#{@config[:schema]}://"
110
+ url.concat "#{@config[:user]}:#{@config[:password]}@"
111
+ url.concat "#{@config[:host]}:#{@config[:port]}"
112
+ if !@config[:wallet].nil? && !@config[:wallet].empty?
113
+ url.concat "/wallet/#{@config[:wallet]}"
114
+ end
115
+ url
116
+ end
117
+
118
118
  def post(url, timeout, open_timeout, payload, headers={}, &block)
119
119
  RestClient::Request.execute(:method => :post, :url => url, :timeout => timeout, :open_timeout => open_timeout, :payload => payload, :headers => headers, &block)
120
120
  end
121
+
121
122
  end
122
123
  end
123
124
  end
@@ -1,3 +1,3 @@
1
1
  module OpenAssets
2
- VERSION = '0.6.7'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -20,11 +20,11 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
  spec.add_runtime_dependency "bitcoin-ruby", "~> 0.0.18"
22
22
  spec.add_runtime_dependency "ffi", "~>1.9.8"
23
- spec.add_runtime_dependency "rest-client", "2.0"
23
+ spec.add_runtime_dependency "rest-client", "2.0.2"
24
24
  spec.add_runtime_dependency "httpclient"
25
25
  spec.add_runtime_dependency "sqlite3"
26
26
  spec.add_runtime_dependency "leb128", '~> 1.0.0'
27
- spec.add_development_dependency "bundler", "~> 1.9"
27
+ spec.add_development_dependency "bundler"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency "rspec"
30
30
  spec.add_development_dependency "timecop"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openassets-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-02 00:00:00.000000000 Z
11
+ date: 2019-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitcoin-ruby
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: 2.0.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: 2.0.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httpclient
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '1.9'
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '1.9'
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -238,8 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  - !ruby/object:Gem::Version
239
239
  version: '0'
240
240
  requirements: []
241
- rubyforge_project:
242
- rubygems_version: 2.6.14
241
+ rubygems_version: 3.0.3
243
242
  signing_key:
244
243
  specification_version: 4
245
244
  summary: The implementation of the Open Assets Protocol for Ruby.