eth 0.4.18 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql.yml +6 -2
  3. data/.github/workflows/docs.yml +1 -1
  4. data/.github/workflows/spec.yml +52 -0
  5. data/.gitignore +24 -24
  6. data/.gitmodules +3 -3
  7. data/.yardopts +1 -0
  8. data/AUTHORS.txt +27 -0
  9. data/CHANGELOG.md +63 -13
  10. data/Gemfile +12 -4
  11. data/LICENSE.txt +202 -22
  12. data/README.md +231 -76
  13. data/bin/console +4 -4
  14. data/bin/setup +5 -4
  15. data/codecov.yml +6 -0
  16. data/eth.gemspec +23 -19
  17. data/lib/eth/abi/type.rb +178 -0
  18. data/lib/eth/abi.rb +396 -0
  19. data/lib/eth/address.rb +57 -10
  20. data/lib/eth/api.rb +223 -0
  21. data/lib/eth/chain.rb +151 -0
  22. data/lib/eth/client/http.rb +63 -0
  23. data/lib/eth/client/ipc.rb +50 -0
  24. data/lib/eth/client.rb +232 -0
  25. data/lib/eth/constant.rb +71 -0
  26. data/lib/eth/eip712.rb +184 -0
  27. data/lib/eth/key/decrypter.rb +121 -85
  28. data/lib/eth/key/encrypter.rb +180 -99
  29. data/lib/eth/key.rb +134 -45
  30. data/lib/eth/rlp/decoder.rb +114 -0
  31. data/lib/eth/rlp/encoder.rb +78 -0
  32. data/lib/eth/rlp/sedes/big_endian_int.rb +66 -0
  33. data/lib/eth/rlp/sedes/binary.rb +97 -0
  34. data/lib/eth/rlp/sedes/list.rb +84 -0
  35. data/lib/eth/rlp/sedes.rb +74 -0
  36. data/lib/eth/rlp.rb +63 -0
  37. data/lib/eth/signature.rb +163 -0
  38. data/lib/eth/solidity.rb +75 -0
  39. data/lib/eth/tx/eip1559.rb +337 -0
  40. data/lib/eth/tx/eip2930.rb +329 -0
  41. data/lib/eth/tx/legacy.rb +297 -0
  42. data/lib/eth/tx.rb +269 -146
  43. data/lib/eth/unit.rb +49 -0
  44. data/lib/eth/util.rb +235 -0
  45. data/lib/eth/version.rb +18 -1
  46. data/lib/eth.rb +34 -67
  47. metadata +47 -95
  48. data/.github/workflows/build.yml +0 -36
  49. data/lib/eth/gas.rb +0 -7
  50. data/lib/eth/open_ssl.rb +0 -395
  51. data/lib/eth/secp256k1.rb +0 -5
  52. data/lib/eth/sedes.rb +0 -39
  53. data/lib/eth/utils.rb +0 -126
data/lib/eth/util.rb ADDED
@@ -0,0 +1,235 @@
1
+ # Copyright (c) 2016-2022 The Ruby-Eth Contributors
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "digest/keccak"
16
+
17
+ # Provides the {Eth} module.
18
+ module Eth
19
+
20
+ # Defines handy tools for the {Eth} gem for convenience.
21
+ module Util
22
+ extend self
23
+
24
+ # Generates an Ethereum address from a given compressed or
25
+ # uncompressed binary or hexadecimal public key string.
26
+ #
27
+ # @param str [String] the public key to be converted.
28
+ # @return [Eth::Address] an Ethereum address.
29
+ def public_key_to_address(str)
30
+ str = hex_to_bin str if is_hex? str
31
+ bytes = keccak256(str[1..-1])[-20..-1]
32
+ Address.new bin_to_prefixed_hex bytes
33
+ end
34
+
35
+ # Hashes a string with the Keccak-256 algorithm.
36
+ #
37
+ # @param str [String] a string to be hashed.
38
+ # @return [String] a Keccak-256 hash of the given string.
39
+ def keccak256(str)
40
+ Digest::Keccak.new(256).digest str
41
+ end
42
+
43
+ # Unpacks a binary string to a hexa-decimal string.
44
+ #
45
+ # @param bin [String] a binary string to be unpacked.
46
+ # @return [String] a hexa-decimal string.
47
+ # @raise [TypeError] if value is not a string.
48
+ def bin_to_hex(bin)
49
+ raise TypeError, "Value must be an instance of String" unless bin.instance_of? String
50
+ bin.unpack("H*").first
51
+ end
52
+
53
+ # Packs a hexa-decimal string into a binary string. Also works with
54
+ # `0x`-prefixed strings.
55
+ #
56
+ # @param hex [String] a hexa-decimal string to be packed.
57
+ # @return [String] a packed binary string.
58
+ # @raise [TypeError] if value is not a string or string is not hex.
59
+ def hex_to_bin(hex)
60
+ raise TypeError, "Value must be an instance of String" unless hex.instance_of? String
61
+ hex = remove_hex_prefix hex
62
+ raise TypeError, "Non-hexadecimal digit found" unless is_hex? hex
63
+ [hex].pack("H*")
64
+ end
65
+
66
+ # Prefixes a hexa-decimal string with `0x`.
67
+ #
68
+ # @param hex [String] a hex-string to be prefixed.
69
+ # @return [String] a prefixed hex-string.
70
+ def prefix_hex(hex)
71
+ return hex if is_prefixed? hex
72
+ return "0x#{hex}"
73
+ end
74
+
75
+ # Removes the `0x` prefix of a hexa-decimal string.
76
+ #
77
+ # @param hex [String] a prefixed hex-string.
78
+ # @return [String] an unprefixed hex-string.
79
+ def remove_hex_prefix(hex)
80
+ return hex[2..-1] if is_prefixed? hex
81
+ return hex
82
+ end
83
+
84
+ # Unpacks a binary string to a prefixed hexa-decimal string.
85
+ #
86
+ # @param bin [String] a binary string to be unpacked.
87
+ # @return [String] a prefixed hexa-decimal string.
88
+ def bin_to_prefixed_hex(bin)
89
+ prefix_hex bin_to_hex bin
90
+ end
91
+
92
+ # Checks if a string is hex-adecimal.
93
+ #
94
+ # @param str [String] a string to be checked.
95
+ # @return [String] a match if true; `nil` if not.
96
+ def is_hex?(str)
97
+ return false unless str.is_a? String
98
+ str = remove_hex_prefix str
99
+ str.match /\A[0-9a-fA-F]*\z/
100
+ end
101
+
102
+ # Checks if a string is prefixed with `0x`.
103
+ #
104
+ # @param hex [String] a string to be checked.
105
+ # @return [String] a match if true; `nil` if not.
106
+ def is_prefixed?(hex)
107
+ hex.match /\A0x/
108
+ end
109
+
110
+ # Serializes an unsigned integer to big endian.
111
+ #
112
+ # @param num [Integer] unsigned integer to be serialized.
113
+ # @return [String] serialized big endian integer string.
114
+ # @raise [ArgumentError] if unsigned integer is out of bounds.
115
+ def serialize_int_to_big_endian(num)
116
+ num = num.to_i(16) if is_hex? num
117
+ unless num.is_a? Integer and num >= 0 and num <= Constant::UINT_MAX
118
+ raise ArgumentError, "Integer invalid or out of range: #{num}"
119
+ end
120
+ Rlp::Sedes.big_endian_int.serialize num
121
+ end
122
+
123
+ # Converts an integer to big endian.
124
+ #
125
+ # @param num [Integer] integer to be converted.
126
+ # @return [String] packed, big-endian integer string.
127
+ def int_to_big_endian(num)
128
+ hex = num.to_s(16) unless is_hex? num
129
+ hex = "0#{hex}" if hex.size.odd?
130
+ hex_to_bin hex
131
+ end
132
+
133
+ # Deserializes big endian data string to integer.
134
+ #
135
+ # @param str [String] serialized big endian integer string.
136
+ # @return [Integer] an deserialized unsigned integer.
137
+ def deserialize_big_endian_to_int(str)
138
+ Rlp::Sedes.big_endian_int.deserialize str.sub(/\A(\x00)+/, "")
139
+ end
140
+
141
+ # Converts a big endian to an interger.
142
+ #
143
+ # @param str [String] big endian to be converted.
144
+ # @return [Integer] an unpacked integer number.
145
+ def big_endian_to_int(str)
146
+ str.unpack("H*").first.to_i(16)
147
+ end
148
+
149
+ # Converts a binary string to bytes.
150
+ #
151
+ # @param str [String] binary string to be converted.
152
+ # @return [Object] the string bytes.
153
+ def str_to_bytes(str)
154
+ is_bytes?(str) ? str : str.b
155
+ end
156
+
157
+ # Converts bytes to a binary string.
158
+ #
159
+ # @param bin [Object] bytes to be converted.
160
+ # @return [String] a packed binary string.
161
+ def bytes_to_str(bin)
162
+ bin.unpack("U*").pack("U*")
163
+ end
164
+
165
+ # Checks if a string is a byte-string.
166
+ #
167
+ # @param str [String] a string to check.
168
+ # @return [Boolean] true if it's an ASCII-8bit encoded byte-string.
169
+ def is_bytes?(str)
170
+ str && str.instance_of?(String) && str.encoding.name == Constant::BINARY_ENCODING
171
+ end
172
+
173
+ # Checks if the given item is a string primitive.
174
+ #
175
+ # @param item [Object] the item to check.
176
+ # @return [Boolean] true if it's a string primitive.
177
+ def is_primitive?(item)
178
+ item.instance_of?(String)
179
+ end
180
+
181
+ # Checks if the given item is a list.
182
+ #
183
+ # @param item [Object] the item to check.
184
+ # @return [Boolean] true if it's a list.
185
+ def is_list?(item)
186
+ !is_primitive?(item) && item.respond_to?(:each)
187
+ end
188
+
189
+ # Ceil and integer to the next multiple of 32 bytes.
190
+ #
191
+ # @param num [Integer] the number to ciel up.
192
+ # @return [Integer] the ceiled to 32 integer.
193
+ def ceil32(num)
194
+ num % 32 == 0 ? num : (num + 32 - num % 32)
195
+ end
196
+
197
+ # Left-pad a number with a symbol.
198
+ #
199
+ # @param str [String] a serialized string to be padded.
200
+ # @param sym [String] a symbol used for left-padding.
201
+ # @param len [Integer] number of symbols for the final string.
202
+ # @return [String] a left-padded serialized string of wanted size.
203
+ def lpad(str, sym, len)
204
+ return str if str.size >= len
205
+ sym * (len - str.size) + str
206
+ end
207
+
208
+ # Left-pad a serialized string with zeros.
209
+ #
210
+ # @param str [String] a serialized string to be padded.
211
+ # @param len [Integer] number of symbols for the final string.
212
+ # @return [String] a zero-padded serialized string of wanted size.
213
+ def zpad(str, len)
214
+ lpad str, Constant::BYTE_ZERO, len
215
+ end
216
+
217
+ # Left-pad a hex number with zeros.
218
+ #
219
+ # @param hex [String] a hex-string to be padded.
220
+ # @param len [Integer] number of symbols for the final string.
221
+ # @return [String] a zero-padded serialized string of wanted size.
222
+ def zpad_hex(hex, len = 32)
223
+ zpad hex_to_bin(hex), len
224
+ end
225
+
226
+ # Left-pad an unsigned integer with zeros.
227
+ #
228
+ # @param num [Integer] an unsigned integer to be padded.
229
+ # @param len [Integer] number of symbols for the final string.
230
+ # @return [String] a zero-padded serialized string of wanted size.
231
+ def zpad_int(num, len = 32)
232
+ zpad serialize_int_to_big_endian(num), len
233
+ end
234
+ end
235
+ end
data/lib/eth/version.rb CHANGED
@@ -1,3 +1,20 @@
1
+ # Copyright (c) 2016-2022 The Ruby-Eth Contributors
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Provides the {Eth} module.
1
16
  module Eth
2
- VERSION = "0.4.18"
17
+
18
+ # Defines the version of the {Eth} module.
19
+ VERSION = "0.5.2".freeze
3
20
  end
data/lib/eth.rb CHANGED
@@ -1,69 +1,36 @@
1
- require "digest/keccak"
2
- require "ffi"
3
- require "money-tree"
4
- require "rlp"
5
-
1
+ # Copyright (c) 2016-2022 The Ruby-Eth Contributors
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Provides the {Eth} module.
6
16
  module Eth
7
- BYTE_ZERO = "\x00".freeze
8
- UINT_MAX = 2 ** 256 - 1
9
-
10
- autoload :Address, "eth/address"
11
- autoload :Gas, "eth/gas"
12
- autoload :Key, "eth/key"
13
- autoload :OpenSsl, "eth/open_ssl"
14
- autoload :Secp256k1, "eth/secp256k1"
15
- autoload :Sedes, "eth/sedes"
16
- autoload :Tx, "eth/tx"
17
- autoload :Utils, "eth/utils"
18
-
19
- class << self
20
- def configure
21
- yield(configuration)
22
- end
23
-
24
- def replayable_chain_id
25
- 27
26
- end
27
-
28
- def chain_id
29
- configuration.chain_id
30
- end
31
-
32
- def v_base
33
- replayable_chain_id
34
- end
35
-
36
- def replayable_v?(v)
37
- [replayable_chain_id, replayable_chain_id + 1].include? v
38
- end
39
-
40
- def tx_data_hex?
41
- !!configuration.tx_data_hex
42
- end
43
-
44
- def chain_id_from_signature(signature)
45
- return nil if Eth.replayable_v?(signature[:v])
46
-
47
- cid = (signature[:v] - 35) / 2
48
- (cid < 1) ? nil : cid
49
- end
50
-
51
- private
52
-
53
- def configuration
54
- @configuration ||= Configuration.new
55
- end
56
- end
57
-
58
- class Configuration
59
- attr_accessor :chain_id, :tx_data_hex
60
-
61
- def initialize
62
- self.chain_id = nil
63
- self.tx_data_hex = true
64
- end
65
- end
66
-
67
- class ValidationError < StandardError; end
68
- class InvalidTransaction < ValidationError; end
69
17
  end
18
+
19
+ # Loads the {Eth} module classes.
20
+ require "eth/abi"
21
+ require "eth/api"
22
+ require "eth/address"
23
+ require "eth/chain"
24
+ require "eth/constant"
25
+ require "eth/client"
26
+ require "eth/client/http"
27
+ require "eth/client/ipc"
28
+ require "eth/eip712"
29
+ require "eth/key"
30
+ require "eth/rlp"
31
+ require "eth/signature"
32
+ require "eth/solidity"
33
+ require "eth/tx"
34
+ require "eth/unit"
35
+ require "eth/util"
36
+ require "eth/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.18
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Ellis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-01-04 00:00:00.000000000 Z
12
+ date: 2022-03-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: keccak
@@ -26,61 +26,47 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.3'
28
28
  - !ruby/object:Gem::Dependency
29
- name: ffi
29
+ name: konstructor
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.15'
34
+ version: '1.0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.15'
41
+ version: '1.0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: money-tree
43
+ name: rbsecp256k1
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0.11'
48
+ version: '5.1'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '0.11'
55
+ version: '5.1'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: openssl
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '3.0'
63
- type: :runtime
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '3.0'
70
- - !ruby/object:Gem::Dependency
71
- name: rlp
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '0.7'
62
+ version: '2.2'
77
63
  type: :runtime
78
64
  prerelease: false
79
65
  version_requirements: !ruby/object:Gem::Requirement
80
66
  requirements:
81
67
  - - "~>"
82
68
  - !ruby/object:Gem::Version
83
- version: '0.7'
69
+ version: '2.2'
84
70
  - !ruby/object:Gem::Dependency
85
71
  name: scrypt
86
72
  requirement: !ruby/object:Gem::Requirement
@@ -95,63 +81,7 @@ dependencies:
95
81
  - - "~>"
96
82
  - !ruby/object:Gem::Version
97
83
  version: '3.0'
98
- - !ruby/object:Gem::Dependency
99
- name: bundler
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: '2.2'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '2.2'
112
- - !ruby/object:Gem::Dependency
113
- name: pry
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '0.14'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '0.14'
126
- - !ruby/object:Gem::Dependency
127
- name: rake
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: '13.0'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: '13.0'
140
- - !ruby/object:Gem::Dependency
141
- name: rspec
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - "~>"
145
- - !ruby/object:Gem::Version
146
- version: '3.10'
147
- type: :development
148
- prerelease: false
149
- version_requirements: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - "~>"
152
- - !ruby/object:Gem::Version
153
- version: '3.10'
154
- description: Library to build, parse, and sign Ethereum transactions.
84
+ description: Library to handle Ethereum accounts, messages, and transactions.
155
85
  email:
156
86
  - email@steveell.is
157
87
  - ruby@q9f.cc
@@ -159,12 +89,14 @@ executables: []
159
89
  extensions: []
160
90
  extra_rdoc_files: []
161
91
  files:
162
- - ".github/workflows/build.yml"
163
92
  - ".github/workflows/codeql.yml"
164
93
  - ".github/workflows/docs.yml"
94
+ - ".github/workflows/spec.yml"
165
95
  - ".gitignore"
166
96
  - ".gitmodules"
167
97
  - ".rspec"
98
+ - ".yardopts"
99
+ - AUTHORS.txt
168
100
  - CHANGELOG.md
169
101
  - Gemfile
170
102
  - LICENSE.txt
@@ -172,27 +104,47 @@ files:
172
104
  - Rakefile
173
105
  - bin/console
174
106
  - bin/setup
107
+ - codecov.yml
175
108
  - eth.gemspec
176
109
  - lib/eth.rb
110
+ - lib/eth/abi.rb
111
+ - lib/eth/abi/type.rb
177
112
  - lib/eth/address.rb
178
- - lib/eth/gas.rb
113
+ - lib/eth/api.rb
114
+ - lib/eth/chain.rb
115
+ - lib/eth/client.rb
116
+ - lib/eth/client/http.rb
117
+ - lib/eth/client/ipc.rb
118
+ - lib/eth/constant.rb
119
+ - lib/eth/eip712.rb
179
120
  - lib/eth/key.rb
180
121
  - lib/eth/key/decrypter.rb
181
122
  - lib/eth/key/encrypter.rb
182
- - lib/eth/open_ssl.rb
183
- - lib/eth/secp256k1.rb
184
- - lib/eth/sedes.rb
123
+ - lib/eth/rlp.rb
124
+ - lib/eth/rlp/decoder.rb
125
+ - lib/eth/rlp/encoder.rb
126
+ - lib/eth/rlp/sedes.rb
127
+ - lib/eth/rlp/sedes/big_endian_int.rb
128
+ - lib/eth/rlp/sedes/binary.rb
129
+ - lib/eth/rlp/sedes/list.rb
130
+ - lib/eth/signature.rb
131
+ - lib/eth/solidity.rb
185
132
  - lib/eth/tx.rb
186
- - lib/eth/utils.rb
133
+ - lib/eth/tx/eip1559.rb
134
+ - lib/eth/tx/eip2930.rb
135
+ - lib/eth/tx/legacy.rb
136
+ - lib/eth/unit.rb
137
+ - lib/eth/util.rb
187
138
  - lib/eth/version.rb
188
- homepage: https://github.com/se3000/ruby-eth
139
+ homepage: https://github.com/q9f/eth.rb
189
140
  licenses:
190
- - MIT
141
+ - Apache-2.0
191
142
  metadata:
192
- homepage_uri: https://github.com/se3000/ruby-eth
193
- source_code_uri: https://github.com/se3000/ruby-eth
194
- github_repo: https://github.com/se3000/ruby-eth
195
- bug_tracker_uri: https://github.com/se3000/ruby-eth/issues
143
+ bug_tracker_uri: https://github.com/q9f/eth.rb/issues
144
+ changelog_uri: https://github.com/q9f/eth.rb/blob/main/CHANGELOG.md
145
+ documentation_uri: https://q9f.github.io/eth.rb/
146
+ github_repo: https://github.com/q9f/eth.rb
147
+ source_code_uri: https://github.com/q9f/eth.rb
196
148
  post_install_message:
197
149
  rdoc_options: []
198
150
  require_paths:
@@ -211,8 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
163
  - !ruby/object:Gem::Version
212
164
  version: '0'
213
165
  requirements: []
214
- rubygems_version: 3.2.32
166
+ rubygems_version: 3.3.8
215
167
  signing_key:
216
168
  specification_version: 4
217
- summary: Simple API to sign Ethereum transactions.
169
+ summary: Ruby Ethereum library.
218
170
  test_files: []
@@ -1,36 +0,0 @@
1
- ---
2
- name: Build
3
-
4
- on:
5
- pull_request:
6
- branches:
7
- - develop
8
- push:
9
- branches:
10
- - develop
11
-
12
- jobs:
13
- build:
14
- runs-on: ${{ matrix.os }}
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- os: [ubuntu-latest, macos-latest]
19
- ruby: ['2.7', '3.0']
20
- steps:
21
- - uses: actions/checkout@v2
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- bundler-cache: true
26
- - name: Brew Automake
27
- run: |
28
- brew install automake
29
- if: startsWith(matrix.os, 'macOS')
30
- - name: Install Dependencies
31
- run: |
32
- git submodule update --init
33
- bundle install
34
- - name: Run Tests
35
- run: |
36
- bundle exec rspec
data/lib/eth/gas.rb DELETED
@@ -1,7 +0,0 @@
1
- module Eth
2
- class Gas
3
- GTXCOST = 21000 # TX BASE GAS COST
4
- GTXDATANONZERO = 68 # TX DATA NON ZERO BYTE GAS COST
5
- GTXDATAZERO = 4 # TX DATA ZERO BYTE GAS COST
6
- end
7
- end