etherlite 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publisher.yaml +25 -0
- data/etherlite.gemspec +15 -14
- data/lib/etherlite/utils.rb +8 -6
- data/lib/etherlite/version.rb +1 -1
- data/lib/etherlite.rb +1 -1
- metadata +52 -46
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e0dfced593354434b36a9de586f7b19828b9f5e7eb30764efd9623b91a3496e
|
4
|
+
data.tar.gz: 68fbf0acbe771dc1c86d94a969f8222b05697c0b954c41ffb78e4017ffa22180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69bdfe008c0d08c9cabcda8f651401715441eba7b97de61fc55e9b99459ac428b17b465eacdfd96698ca5cd361d7133a0c17b70e964684ae9d0cb279d5ccc861
|
7
|
+
data.tar.gz: dc82638a7c9a62c28bb507e0e213fe3afcf5836f2a11b8b717b6caac1b06c87bc9073373fbb0e88d0fab43557de4bf8d4be9be1ea04c9a2c0ecbc62cb4d00c3f
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Publish to rubygems
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v3
|
12
|
+
- uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 3.0.0
|
15
|
+
- run: bundle install
|
16
|
+
- name: publish gem
|
17
|
+
run: |
|
18
|
+
mkdir -p $HOME/.gem
|
19
|
+
touch $HOME/.gem/credentials
|
20
|
+
chmod 0600 $HOME/.gem/credentials
|
21
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
22
|
+
gem build *.gemspec
|
23
|
+
gem push *.gem
|
24
|
+
env:
|
25
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
|
data/etherlite.gemspec
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'etherlite/version'
|
5
4
|
|
@@ -7,28 +6,30 @@ Gem::Specification.new do |spec|
|
|
7
6
|
spec.name = "etherlite"
|
8
7
|
spec.version = Etherlite::VERSION
|
9
8
|
spec.authors = ["Ignacio Baixas"]
|
10
|
-
spec.email = ["ignacio@
|
9
|
+
spec.email = ["ignacio@budacom.com"]
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage = "https://github.com/
|
11
|
+
spec.summary = 'Ethereum integration for ruby on rails'
|
12
|
+
spec.description = ''
|
13
|
+
spec.homepage = "https://github.com/budacom/etherlite"
|
15
14
|
spec.license = "MIT"
|
16
15
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
18
19
|
spec.bindir = "exe"
|
19
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
21
|
spec.require_paths = ["lib"]
|
21
22
|
|
22
|
-
spec.add_dependency "digest-sha3", "~> 1.1"
|
23
|
-
spec.add_dependency "power-types", "~> 0.1"
|
24
|
-
spec.add_dependency "eth", "~> 0.4.4"
|
25
23
|
spec.add_dependency "activesupport"
|
24
|
+
spec.add_dependency "eth", "~> 0.4.4"
|
25
|
+
spec.add_dependency 'keccak', '~> 1.3', '>= 1.3.1'
|
26
|
+
spec.add_dependency "power-types", "~> 0.1"
|
26
27
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 2.1
|
28
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
30
29
|
spec.add_development_dependency "guard", "~> 2.14"
|
31
30
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
32
|
-
spec.add_development_dependency "webmock", "~> 3.7.5"
|
33
31
|
spec.add_development_dependency "pry"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
34
|
+
spec.add_development_dependency "webmock", "~> 3.7.5"
|
34
35
|
end
|
data/lib/etherlite/utils.rb
CHANGED
@@ -5,7 +5,7 @@ module Etherlite
|
|
5
5
|
extend self
|
6
6
|
|
7
7
|
def sha3(_data)
|
8
|
-
Digest::
|
8
|
+
Digest::Keccak.hexdigest(_data, 256)
|
9
9
|
end
|
10
10
|
|
11
11
|
def uint_to_hex(_value, bytes: 32)
|
@@ -13,7 +13,7 @@ module Etherlite
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def int_to_hex(_value, bytes: 32)
|
16
|
-
if _value
|
16
|
+
if _value.negative?
|
17
17
|
# 2's complement for negative values
|
18
18
|
(_value & ((1 << bytes * 8) - 1)).to_s(16)
|
19
19
|
else
|
@@ -28,7 +28,7 @@ module Etherlite
|
|
28
28
|
def hex_to_int(_hex_value, bytes: 32)
|
29
29
|
value = _hex_value.hex
|
30
30
|
top_bit = (1 << (bytes * 8 - 1))
|
31
|
-
value & top_bit
|
31
|
+
(value & top_bit).positive? ? (value - 2 * top_bit) : value
|
32
32
|
end
|
33
33
|
|
34
34
|
def valid_address?(_address)
|
@@ -45,21 +45,23 @@ module Etherlite
|
|
45
45
|
else
|
46
46
|
_value = _value.to_s
|
47
47
|
raise ArgumentError, 'invalid address' unless valid_address? _value
|
48
|
+
|
48
49
|
normalize_address _value
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
53
|
def encode_address_param(_value)
|
53
|
-
|
54
|
+
"0x#{normalize_address_param(_value)}"
|
54
55
|
end
|
55
56
|
|
56
57
|
def encode_block_param(_value)
|
57
58
|
return _value.to_s if ['pending', 'earliest', 'latest'].include?(_value.to_s)
|
58
|
-
|
59
|
+
|
60
|
+
"0x#{_value.to_s(16)}"
|
59
61
|
end
|
60
62
|
|
61
63
|
def encode_quantity_param(_value)
|
62
|
-
|
64
|
+
"0x#{_value.to_s(16)}"
|
63
65
|
end
|
64
66
|
end
|
65
67
|
end
|
data/lib/etherlite/version.rb
CHANGED
data/lib/etherlite.rb
CHANGED
metadata
CHANGED
@@ -1,179 +1,185 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etherlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignacio Baixas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: eth
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.4.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.4.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: keccak
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '1.3'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 1.3.1
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
55
|
- - "~>"
|
53
56
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
57
|
+
version: '1.3'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.3.1
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
62
|
+
name: power-types
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
|
-
- - "
|
65
|
+
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
67
|
+
version: '0.1'
|
62
68
|
type: :runtime
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
|
-
- - "
|
72
|
+
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
74
|
+
version: '0.1'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: bundler
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.1
|
81
|
+
version: '2.1'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.1
|
88
|
+
version: '2.1'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
90
|
+
name: guard
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
86
92
|
requirements:
|
87
93
|
- - "~>"
|
88
94
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
95
|
+
version: '2.14'
|
90
96
|
type: :development
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
100
|
- - "~>"
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
102
|
+
version: '2.14'
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: rspec
|
104
|
+
name: guard-rspec
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
100
106
|
requirements:
|
101
107
|
- - "~>"
|
102
108
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
109
|
+
version: '4.7'
|
104
110
|
type: :development
|
105
111
|
prerelease: false
|
106
112
|
version_requirements: !ruby/object:Gem::Requirement
|
107
113
|
requirements:
|
108
114
|
- - "~>"
|
109
115
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
116
|
+
version: '4.7'
|
111
117
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
118
|
+
name: pry
|
113
119
|
requirement: !ruby/object:Gem::Requirement
|
114
120
|
requirements:
|
115
|
-
- - "
|
121
|
+
- - ">="
|
116
122
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
123
|
+
version: '0'
|
118
124
|
type: :development
|
119
125
|
prerelease: false
|
120
126
|
version_requirements: !ruby/object:Gem::Requirement
|
121
127
|
requirements:
|
122
|
-
- - "
|
128
|
+
- - ">="
|
123
129
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
130
|
+
version: '0'
|
125
131
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
132
|
+
name: rake
|
127
133
|
requirement: !ruby/object:Gem::Requirement
|
128
134
|
requirements:
|
129
135
|
- - "~>"
|
130
136
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
137
|
+
version: '10.0'
|
132
138
|
type: :development
|
133
139
|
prerelease: false
|
134
140
|
version_requirements: !ruby/object:Gem::Requirement
|
135
141
|
requirements:
|
136
142
|
- - "~>"
|
137
143
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
144
|
+
version: '10.0'
|
139
145
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
146
|
+
name: rspec
|
141
147
|
requirement: !ruby/object:Gem::Requirement
|
142
148
|
requirements:
|
143
149
|
- - "~>"
|
144
150
|
- !ruby/object:Gem::Version
|
145
|
-
version: 3.
|
151
|
+
version: '3.0'
|
146
152
|
type: :development
|
147
153
|
prerelease: false
|
148
154
|
version_requirements: !ruby/object:Gem::Requirement
|
149
155
|
requirements:
|
150
156
|
- - "~>"
|
151
157
|
- !ruby/object:Gem::Version
|
152
|
-
version: 3.
|
158
|
+
version: '3.0'
|
153
159
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
160
|
+
name: webmock
|
155
161
|
requirement: !ruby/object:Gem::Requirement
|
156
162
|
requirements:
|
157
|
-
- - "
|
163
|
+
- - "~>"
|
158
164
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
165
|
+
version: 3.7.5
|
160
166
|
type: :development
|
161
167
|
prerelease: false
|
162
168
|
version_requirements: !ruby/object:Gem::Requirement
|
163
169
|
requirements:
|
164
|
-
- - "
|
170
|
+
- - "~>"
|
165
171
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
172
|
+
version: 3.7.5
|
167
173
|
description: ''
|
168
174
|
email:
|
169
|
-
- ignacio@
|
175
|
+
- ignacio@budacom.com
|
170
176
|
executables: []
|
171
177
|
extensions: []
|
172
178
|
extra_rdoc_files: []
|
173
179
|
files:
|
180
|
+
- ".github/workflows/publisher.yaml"
|
174
181
|
- ".gitignore"
|
175
182
|
- ".rspec"
|
176
|
-
- ".travis.yml"
|
177
183
|
- CODE_OF_CONDUCT.md
|
178
184
|
- Gemfile
|
179
185
|
- Guardfile
|
@@ -229,7 +235,7 @@ files:
|
|
229
235
|
- lib/etherlite/version.rb
|
230
236
|
- lib/generators/etherlite/init_generator.rb
|
231
237
|
- lib/generators/etherlite/templates/etherlite.yml
|
232
|
-
homepage: https://github.com/
|
238
|
+
homepage: https://github.com/budacom/etherlite
|
233
239
|
licenses:
|
234
240
|
- MIT
|
235
241
|
metadata: {}
|
@@ -248,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
254
|
- !ruby/object:Gem::Version
|
249
255
|
version: '0'
|
250
256
|
requirements: []
|
251
|
-
rubygems_version: 3.
|
257
|
+
rubygems_version: 3.2.3
|
252
258
|
signing_key:
|
253
259
|
specification_version: 4
|
254
260
|
summary: Ethereum integration for ruby on rails
|