openassets 1.0.0 → 1.1.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: 10809c4205c9ab9a83ec79f6f0d2ba5e5d5f24a06b1c86c23b2e3838866c17ff
4
- data.tar.gz: ca9c2b3d2c86863e341ccb01c57f59e6598ebe77902ad6081300973b05b3e372
3
+ metadata.gz: 3279be35952e0a7901f73489f7309600bb8b2f86aa31045ed018d1df1ddbbe53
4
+ data.tar.gz: fd3c7241074c942dc9cc32bd8d1388cb49434dbfb275cbec7139b762addb5462
5
5
  SHA512:
6
- metadata.gz: 61da26f64df67616874717ffe67955c47de7a3cdc4ce8f04de539a9dcbfb675292378debd8490403d57545d92045135aa408bcfaa561422982f2d1371c0585a2
7
- data.tar.gz: 6a47b0b4e57efd436e273a9e09a6b61d68be28e5bdbf8670b5a468f87cfe6e5f3ac7d5d3d922cc2c6e4ad63b79aa336968c62aaaba6383c1306467c0c34bbd55
6
+ metadata.gz: fa9c3cf2d6643125a394dc2844ec6707febef7f38d849207d6dfd91530566068eff8f6a7d709a4a4a98f791085a17c69c5be3a2a0abcb23e84a3e9ebb64399e1
7
+ data.tar.gz: 5823bdefb84bfe84110537e89bfe0a0834fef707dd99fc2d47fb4bf7f5fbe531777a94c8445a3574d8d8be06f01a5471c5f6190e1d542528abbda2fd995bee9c
@@ -0,0 +1,34 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['3.1', '3.2', '3.3', '3.4']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Set up Ruby
27
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby-version }}
32
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
+ - name: Run tests
34
+ run: bundle exec rake spec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.3
1
+ ruby-3.4.5
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # openassetsrb [![Build Status](https://travis-ci.org/chaintope/openassetsrb.svg?branch=master)](https://travis-ci.org/chaintope/openassetsrb) [![Gem Version](https://badge.fury.io/rb/openassetsrb.svg)](https://badge.fury.io/rb/openassetsrb) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
1
+ # openassetsrb [![Gem Version](https://badge.fury.io/rb/openassets.svg)](https://badge.fury.io/rb/openassets) [![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
  This library is a fork of [openassets-ruby](https://github.com/haw/openassets-ruby).
@@ -60,7 +60,7 @@ module OpenAssets
60
60
  sorted_outputs = colored_outputs.sort_by { |o|o.script.to_s}
61
61
  groups = sorted_outputs.group_by{|o| o.script.to_s}
62
62
  result = groups.map{|k, v|
63
- btc_address = v[0].script.addresses.first
63
+ btc_address = v[0].script.to_addr
64
64
  sorted_script_outputs = v.sort_by{|o|o.asset_id unless o.asset_id}
65
65
  group_assets = sorted_script_outputs.group_by{|o|o.asset_id}.select{|k,v| !k.nil?}
66
66
  assets = group_assets.map{|asset_id, outputs|
@@ -98,7 +98,8 @@ module OpenAssets
98
98
  subject = cache.get(asset_definition_url)
99
99
  if subject.nil?
100
100
  client = HTTPClient.new
101
- client.redirect_uri_callback = ->(uri, res) {res.header['location'][0]}
101
+ client.ssl_config.set_trust_ca(ENV['SSL_CERT_FILE'] || '/etc/ssl/certs/ca-certificates.crt')
102
+ client.redirect_uri_callback = ->(_, res) { res.header['location'][0] }
102
103
  response = client.get(asset_definition_url, :follow_redirect => true)
103
104
  cert = response.peer_cert
104
105
  unless cert.nil?
@@ -72,7 +72,7 @@ module OpenAssets
72
72
  end
73
73
 
74
74
  def address
75
- return @script.addresses.first if @script.p2pkh? || @script.p2sh? || @script.p2wpkh? || @script.p2wsh?
75
+ return @script.to_addr if @script.p2pkh? || @script.p2sh? || @script.p2wpkh? || @script.p2wsh?
76
76
  nil # TODO Bitcoin::Script#to_addr after it enable
77
77
  end
78
78
 
@@ -1,3 +1,3 @@
1
1
  module OpenAssets
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
data/openassets.gemspec CHANGED
@@ -18,16 +18,15 @@ Gem::Specification.new do |spec|
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
- spec.add_runtime_dependency "bitcoinrb", ">= 0.3.2"
22
- spec.add_runtime_dependency "ffi", "~>1.9.8"
21
+ spec.add_runtime_dependency "bitcoinrb", ">= 1.9.1"
23
22
  spec.add_runtime_dependency "rest-client", "2.0.2"
24
23
  spec.add_runtime_dependency "httpclient"
25
24
  spec.add_runtime_dependency "sqlite3"
26
25
  spec.add_runtime_dependency "leb128", '~> 1.0.0'
26
+ spec.add_runtime_dependency "bigdecimal"
27
27
  spec.add_development_dependency "bundler"
28
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rake", ">= 12.3.3"
29
29
  spec.add_development_dependency "rspec"
30
30
  spec.add_development_dependency "timecop"
31
- spec.add_development_dependency "travis"
32
31
 
33
32
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openassets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2019-12-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bitcoinrb
@@ -16,28 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.3.2
18
+ version: 1.9.1
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 0.3.2
27
- - !ruby/object:Gem::Dependency
28
- name: ffi
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 1.9.8
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 1.9.8
25
+ version: 1.9.1
41
26
  - !ruby/object:Gem::Dependency
42
27
  name: rest-client
43
28
  requirement: !ruby/object:Gem::Requirement
@@ -95,13 +80,13 @@ dependencies:
95
80
  - !ruby/object:Gem::Version
96
81
  version: 1.0.0
97
82
  - !ruby/object:Gem::Dependency
98
- name: bundler
83
+ name: bigdecimal
99
84
  requirement: !ruby/object:Gem::Requirement
100
85
  requirements:
101
86
  - - ">="
102
87
  - !ruby/object:Gem::Version
103
88
  version: '0'
104
- type: :development
89
+ type: :runtime
105
90
  prerelease: false
106
91
  version_requirements: !ruby/object:Gem::Requirement
107
92
  requirements:
@@ -109,35 +94,35 @@ dependencies:
109
94
  - !ruby/object:Gem::Version
110
95
  version: '0'
111
96
  - !ruby/object:Gem::Dependency
112
- name: rake
97
+ name: bundler
113
98
  requirement: !ruby/object:Gem::Requirement
114
99
  requirements:
115
- - - "~>"
100
+ - - ">="
116
101
  - !ruby/object:Gem::Version
117
- version: '10.0'
102
+ version: '0'
118
103
  type: :development
119
104
  prerelease: false
120
105
  version_requirements: !ruby/object:Gem::Requirement
121
106
  requirements:
122
- - - "~>"
107
+ - - ">="
123
108
  - !ruby/object:Gem::Version
124
- version: '10.0'
109
+ version: '0'
125
110
  - !ruby/object:Gem::Dependency
126
- name: rspec
111
+ name: rake
127
112
  requirement: !ruby/object:Gem::Requirement
128
113
  requirements:
129
114
  - - ">="
130
115
  - !ruby/object:Gem::Version
131
- version: '0'
116
+ version: 12.3.3
132
117
  type: :development
133
118
  prerelease: false
134
119
  version_requirements: !ruby/object:Gem::Requirement
135
120
  requirements:
136
121
  - - ">="
137
122
  - !ruby/object:Gem::Version
138
- version: '0'
123
+ version: 12.3.3
139
124
  - !ruby/object:Gem::Dependency
140
- name: timecop
125
+ name: rspec
141
126
  requirement: !ruby/object:Gem::Requirement
142
127
  requirements:
143
128
  - - ">="
@@ -151,7 +136,7 @@ dependencies:
151
136
  - !ruby/object:Gem::Version
152
137
  version: '0'
153
138
  - !ruby/object:Gem::Dependency
154
- name: travis
139
+ name: timecop
155
140
  requirement: !ruby/object:Gem::Requirement
156
141
  requirements:
157
142
  - - ">="
@@ -172,11 +157,11 @@ executables:
172
157
  extensions: []
173
158
  extra_rdoc_files: []
174
159
  files:
160
+ - ".github/workflows/ruby.yml"
175
161
  - ".gitignore"
176
162
  - ".rspec"
177
163
  - ".ruby-gemset"
178
164
  - ".ruby-version"
179
- - ".travis.yml"
180
165
  - CODE_OF_CONDUCT.md
181
166
  - Gemfile
182
167
  - LICENSE
@@ -222,7 +207,6 @@ homepage: https://github.com/chaintope/openassetsrb
222
207
  licenses:
223
208
  - MIT
224
209
  metadata: {}
225
- post_install_message:
226
210
  rdoc_options: []
227
211
  require_paths:
228
212
  - lib
@@ -237,8 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
221
  - !ruby/object:Gem::Version
238
222
  version: '0'
239
223
  requirements: []
240
- rubygems_version: 3.0.3
241
- signing_key:
224
+ rubygems_version: 3.6.9
242
225
  specification_version: 4
243
226
  summary: The implementation of the Open Assets Protocol for Ruby.
244
227
  test_files: []
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.3
4
- - 2.5.5
5
- - 2.4.5
6
- - 2.3.0
7
-
8
- bundler_args: --jobs=2
9
-
10
- script:
11
- - bundle exec rake spec