eth 0.5.7 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql.yml +1 -1
  3. data/.github/workflows/docs.yml +2 -2
  4. data/.github/workflows/spec.yml +3 -3
  5. data/CHANGELOG.md +33 -0
  6. data/Gemfile +2 -2
  7. data/LICENSE.txt +1 -1
  8. data/README.md +1 -1
  9. data/abis/ens.json +422 -0
  10. data/eth.gemspec +2 -2
  11. data/lib/eth/abi/event.rb +1 -1
  12. data/lib/eth/abi/type.rb +46 -12
  13. data/lib/eth/abi.rb +72 -14
  14. data/lib/eth/address.rb +2 -2
  15. data/lib/eth/api.rb +1 -1
  16. data/lib/eth/chain.rb +19 -7
  17. data/lib/eth/client/http.rb +1 -1
  18. data/lib/eth/client/http_auth.rb +1 -1
  19. data/lib/eth/client/ipc.rb +1 -1
  20. data/lib/eth/client.rb +70 -58
  21. data/lib/eth/constant.rb +1 -1
  22. data/lib/eth/contract/event.rb +1 -1
  23. data/lib/eth/contract/function.rb +2 -2
  24. data/lib/eth/contract/function_input.rb +7 -2
  25. data/lib/eth/contract/function_output.rb +1 -1
  26. data/lib/eth/contract/initializer.rb +1 -1
  27. data/lib/eth/contract.rb +1 -1
  28. data/lib/eth/eip712.rb +2 -2
  29. data/lib/eth/ens/resolver.rb +77 -0
  30. data/lib/eth/key/decrypter.rb +1 -1
  31. data/lib/eth/key/encrypter.rb +1 -1
  32. data/lib/eth/key.rb +5 -5
  33. data/lib/eth/rlp/decoder.rb +2 -2
  34. data/lib/eth/rlp/encoder.rb +3 -3
  35. data/lib/eth/rlp/sedes/big_endian_int.rb +1 -1
  36. data/lib/eth/rlp/sedes/binary.rb +2 -2
  37. data/lib/eth/rlp/sedes/list.rb +5 -5
  38. data/lib/eth/rlp/sedes.rb +4 -4
  39. data/lib/eth/rlp.rb +1 -1
  40. data/lib/eth/signature.rb +4 -4
  41. data/lib/eth/solidity.rb +5 -3
  42. data/lib/eth/tx/eip1559.rb +3 -3
  43. data/lib/eth/tx/eip2930.rb +3 -3
  44. data/lib/eth/tx/legacy.rb +3 -3
  45. data/lib/eth/tx.rb +5 -5
  46. data/lib/eth/unit.rb +1 -1
  47. data/lib/eth/util.rb +14 -14
  48. data/lib/eth/version.rb +2 -2
  49. data/lib/eth.rb +2 -1
  50. metadata +7 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86b3022f82e96aed2d1aad682ad106f3f5efe9488e03ed048e0c5862d30c3284
4
- data.tar.gz: 40cb5224db9e074360586aca07f6421edc47668fa0f5d81728fa7574f0c2a978
3
+ metadata.gz: b38c43c0d7f3c1403c02e847d02623120bab91260ac0dc841f43719302413e1b
4
+ data.tar.gz: 41f4086d2911a30869c7cf5c4e63bfff54d618cb16756f5cbebc4f4accb4b26c
5
5
  SHA512:
6
- metadata.gz: cf5872ec79f0c708a5c05060514b9179279db310b1c0c0682679cd90bcd0998f9ef1a7f8787c298380a252462c5ea33fdc3d44c0bdb5e3c57991515514077b85
7
- data.tar.gz: 4a7adde0050a724270f5779a2fe4fca596202a930ee7e1af1e4493878a21e7102ee75a2d5ce91ac455b016c9c396d6771396e5c890f5dcef7ea220b0eadd2d58
6
+ metadata.gz: 45549c5b9c4deace4df8bbcd34c2e4a02476a4175aa8ea865249bb01983c484d85d67954f3b7e68193b16425e8c83efcd4415cd7c2034730fcd8d0d1a324cf34
7
+ data.tar.gz: e1dc19f40eaa284ae09faa6fc70d510ae782b1014f95c0b490dfa8ad86dbf6c9f505b47b6c530217258c33279c204ac6be445fd11fe341bcb302492c95d7b69d
@@ -35,7 +35,7 @@ jobs:
35
35
  uses: github/codeql-action/analyze@v2
36
36
  - uses: ruby/setup-ruby@v1
37
37
  with:
38
- ruby-version: '2.7'
38
+ ruby-version: '3.0'
39
39
  bundler-cache: true
40
40
  - name: "Run rufo code formatting checks"
41
41
  run: |
@@ -13,14 +13,14 @@ jobs:
13
13
  - uses: actions/checkout@v3
14
14
  - uses: ruby/setup-ruby@v1
15
15
  with:
16
- ruby-version: '2.7'
16
+ ruby-version: '3.0'
17
17
  bundler-cache: true
18
18
  - name: Run Yard Doc
19
19
  run: |
20
20
  gem install yard
21
21
  yard doc
22
22
  - name: Deploy GH Pages
23
- uses: JamesIves/github-pages-deploy-action@v4.4.0
23
+ uses: JamesIves/github-pages-deploy-action@v4.4.1
24
24
  with:
25
25
  branch: gh-pages
26
26
  folder: doc/
@@ -18,8 +18,8 @@ jobs:
18
18
  strategy:
19
19
  fail-fast: false
20
20
  matrix:
21
- os: [ubuntu-latest, macos-latest]
22
- ruby: ['2.7', '3.1']
21
+ os: [ubuntu-22.04, macos-12]
22
+ ruby: ['3.0', '3.1']
23
23
  steps:
24
24
  - uses: actions/checkout@v3
25
25
  - uses: ruby/setup-ruby@v1
@@ -35,7 +35,7 @@ jobs:
35
35
  run: |
36
36
  sudo add-apt-repository -y ppa:ethereum/ethereum
37
37
  sudo apt-get update
38
- sudo apt-get install ethereum solc
38
+ sudo apt-get install ethereum solc libyaml-dev
39
39
  if: startsWith(matrix.os, 'Ubuntu')
40
40
  - name: Run Geth
41
41
  run: |
data/CHANGELOG.md CHANGED
@@ -1,6 +1,39 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.5.8]
5
+ ### Added
6
+ * Client: ability to manual set nonce of tx for transfer, deploy, transact methods was added. [#169](https://github.com/q9f/eth.rb/pull/169)
7
+ * Client: ability for call contract methods with specific transaction value was added [#168](https://github.com/q9f/eth.rb/pull/168)
8
+ * Client: add ENS resolve support [#150](https://github.com/q9f/eth.rb/pull/150)
9
+
10
+ ### Changed
11
+ * Client: satisfy yard docs for transfer kwargs [#170](https://github.com/q9f/eth.rb/pull/170)
12
+ * Client: remove invalid parameters from call_raw method [#166](https://github.com/q9f/eth.rb/pull/166)
13
+ * Gem: bump required ruby version to 3 [#165](https://github.com/q9f/eth.rb/pull/165)
14
+ * Build(deps): bump JamesIves/github-pages-deploy-action from 4.4.0 to 4.4.1 [#162](https://github.com/q9f/eth.rb/pull/162)
15
+ * Gem: bump version to 0.5.8 [#161](https://github.com/q9f/eth.rb/pull/161)
16
+ * Docs: update changelog [#160](https://github.com/q9f/eth.rb/pull/160)
17
+
18
+ ## [0.5.7]
19
+ ### Added
20
+ * Eth/client: add http basic support auth ([#151](https://github.com/q9f/eth.rb/pull/151))
21
+ * Chore: add polygon chain test case ([#146](https://github.com/q9f/eth.rb/pull/146))
22
+
23
+ ### Changed
24
+ * Docs: add readme header for yard ([#159](https://github.com/q9f/eth.rb/pull/159))
25
+ * Eth/client: fix api documentation ([#158](https://github.com/q9f/eth.rb/pull/158))
26
+ * Eth/client: update default fees ([#157](https://github.com/q9f/eth.rb/pull/157))
27
+ * Docs: move readme usage to wiki ([#156](https://github.com/q9f/eth.rb/pull/156))
28
+ * Eth/signature: fix allowing ledger v values of 0 ([#155](https://github.com/q9f/eth.rb/pull/155))
29
+ * Eth/client: rename http basic to http auth ([#154](https://github.com/q9f/eth.rb/pull/154))
30
+ * Fix Eth:Tx.decode for transaction with s length < 64 chars ([#148](https://github.com/q9f/eth.rb/pull/148))
31
+ * Build(deps): bump JamesIves/github-pages-deploy-action from 4.3.4 to 4.4.0 ([#140](https://github.com/q9f/eth.rb/pull/140))
32
+ * Fixed to return uint256[] correctly when passed as type ([#147](https://github.com/q9f/eth.rb/pull/147))
33
+ * Build(deps): bump JamesIves/github-pages-deploy-action from 4.3.3 to 4.3.4 ([#133](https://github.com/q9f/eth.rb/pull/133))
34
+ * Docs: update CHANGELOG ([#132](https://github.com/q9f/eth.rb/pull/132))
35
+ * Gem: bump version to 0.5.7 ([#131](https://github.com/q9f/eth.rb/pull/131))
36
+
4
37
  ## [0.5.6]
5
38
  ### Added
6
39
  - Eth/client: Add gas limit override option for contract deployments ([#128](https://github.com/q9f/eth.rb/pull/128))
data/Gemfile CHANGED
@@ -7,8 +7,8 @@ group :test, :development do
7
7
  gem "codecov", "~> 0.6"
8
8
  gem "pry", "~> 0.14"
9
9
  gem "rake", "~> 13.0"
10
- gem "rdoc", "~> 6.3"
11
- gem "rspec", "~> 3.10"
10
+ gem "rdoc", "~> 6.4"
11
+ gem "rspec", "~> 3.11"
12
12
  gem "rufo", "~> 0.13"
13
13
  gem "simplecov", "~> 0.21"
14
14
  gem "yard", "~> 0.9"
data/LICENSE.txt CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright (c) 2016-2022 The Ruby-Eth Contributors
190
+ Copyright (c) 2016-2023 The Ruby-Eth Contributors
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Ethereum for Ruby
8
8
 
9
- [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/q9f/eth.rb/Spec)](https://github.com/q9f/eth.rb/actions)
9
+ [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/q9f/eth.rb/spec.yml?branch=main)](https://github.com/q9f/eth.rb/actions)
10
10
  [![GitHub release (latest by date)](https://img.shields.io/github/v/release/q9f/eth.rb)](https://github.com/q9f/eth.rb/releases)
11
11
  [![Gem](https://img.shields.io/gem/v/eth)](https://rubygems.org/gems/eth)
12
12
  [![Gem](https://img.shields.io/gem/dt/eth)](https://rubygems.org/gems/eth)
data/abis/ens.json ADDED
@@ -0,0 +1,422 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "contract ENS",
6
+ "name": "_old",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "payable": false,
11
+ "stateMutability": "nonpayable",
12
+ "type": "constructor"
13
+ },
14
+ {
15
+ "anonymous": false,
16
+ "inputs": [
17
+ {
18
+ "indexed": true,
19
+ "internalType": "address",
20
+ "name": "owner",
21
+ "type": "address"
22
+ },
23
+ {
24
+ "indexed": true,
25
+ "internalType": "address",
26
+ "name": "operator",
27
+ "type": "address"
28
+ },
29
+ {
30
+ "indexed": false,
31
+ "internalType": "bool",
32
+ "name": "approved",
33
+ "type": "bool"
34
+ }
35
+ ],
36
+ "name": "ApprovalForAll",
37
+ "type": "event"
38
+ },
39
+ {
40
+ "anonymous": false,
41
+ "inputs": [
42
+ {
43
+ "indexed": true,
44
+ "internalType": "bytes32",
45
+ "name": "node",
46
+ "type": "bytes32"
47
+ },
48
+ {
49
+ "indexed": true,
50
+ "internalType": "bytes32",
51
+ "name": "label",
52
+ "type": "bytes32"
53
+ },
54
+ {
55
+ "indexed": false,
56
+ "internalType": "address",
57
+ "name": "owner",
58
+ "type": "address"
59
+ }
60
+ ],
61
+ "name": "NewOwner",
62
+ "type": "event"
63
+ },
64
+ {
65
+ "anonymous": false,
66
+ "inputs": [
67
+ {
68
+ "indexed": true,
69
+ "internalType": "bytes32",
70
+ "name": "node",
71
+ "type": "bytes32"
72
+ },
73
+ {
74
+ "indexed": false,
75
+ "internalType": "address",
76
+ "name": "resolver",
77
+ "type": "address"
78
+ }
79
+ ],
80
+ "name": "NewResolver",
81
+ "type": "event"
82
+ },
83
+ {
84
+ "anonymous": false,
85
+ "inputs": [
86
+ {
87
+ "indexed": true,
88
+ "internalType": "bytes32",
89
+ "name": "node",
90
+ "type": "bytes32"
91
+ },
92
+ {
93
+ "indexed": false,
94
+ "internalType": "uint64",
95
+ "name": "ttl",
96
+ "type": "uint64"
97
+ }
98
+ ],
99
+ "name": "NewTTL",
100
+ "type": "event"
101
+ },
102
+ {
103
+ "anonymous": false,
104
+ "inputs": [
105
+ {
106
+ "indexed": true,
107
+ "internalType": "bytes32",
108
+ "name": "node",
109
+ "type": "bytes32"
110
+ },
111
+ {
112
+ "indexed": false,
113
+ "internalType": "address",
114
+ "name": "owner",
115
+ "type": "address"
116
+ }
117
+ ],
118
+ "name": "Transfer",
119
+ "type": "event"
120
+ },
121
+ {
122
+ "constant": true,
123
+ "inputs": [
124
+ {
125
+ "internalType": "address",
126
+ "name": "owner",
127
+ "type": "address"
128
+ },
129
+ {
130
+ "internalType": "address",
131
+ "name": "operator",
132
+ "type": "address"
133
+ }
134
+ ],
135
+ "name": "isApprovedForAll",
136
+ "outputs": [
137
+ {
138
+ "internalType": "bool",
139
+ "name": "",
140
+ "type": "bool"
141
+ }
142
+ ],
143
+ "payable": false,
144
+ "stateMutability": "view",
145
+ "type": "function"
146
+ },
147
+ {
148
+ "constant": true,
149
+ "inputs": [],
150
+ "name": "old",
151
+ "outputs": [
152
+ {
153
+ "internalType": "contract ENS",
154
+ "name": "",
155
+ "type": "address"
156
+ }
157
+ ],
158
+ "payable": false,
159
+ "stateMutability": "view",
160
+ "type": "function"
161
+ },
162
+ {
163
+ "constant": true,
164
+ "inputs": [
165
+ {
166
+ "internalType": "bytes32",
167
+ "name": "node",
168
+ "type": "bytes32"
169
+ }
170
+ ],
171
+ "name": "owner",
172
+ "outputs": [
173
+ {
174
+ "internalType": "address",
175
+ "name": "",
176
+ "type": "address"
177
+ }
178
+ ],
179
+ "payable": false,
180
+ "stateMutability": "view",
181
+ "type": "function"
182
+ },
183
+ {
184
+ "constant": true,
185
+ "inputs": [
186
+ {
187
+ "internalType": "bytes32",
188
+ "name": "node",
189
+ "type": "bytes32"
190
+ }
191
+ ],
192
+ "name": "recordExists",
193
+ "outputs": [
194
+ {
195
+ "internalType": "bool",
196
+ "name": "",
197
+ "type": "bool"
198
+ }
199
+ ],
200
+ "payable": false,
201
+ "stateMutability": "view",
202
+ "type": "function"
203
+ },
204
+ {
205
+ "constant": true,
206
+ "inputs": [
207
+ {
208
+ "internalType": "bytes32",
209
+ "name": "node",
210
+ "type": "bytes32"
211
+ }
212
+ ],
213
+ "name": "resolver",
214
+ "outputs": [
215
+ {
216
+ "internalType": "address",
217
+ "name": "",
218
+ "type": "address"
219
+ }
220
+ ],
221
+ "payable": false,
222
+ "stateMutability": "view",
223
+ "type": "function"
224
+ },
225
+ {
226
+ "constant": false,
227
+ "inputs": [
228
+ {
229
+ "internalType": "address",
230
+ "name": "operator",
231
+ "type": "address"
232
+ },
233
+ {
234
+ "internalType": "bool",
235
+ "name": "approved",
236
+ "type": "bool"
237
+ }
238
+ ],
239
+ "name": "setApprovalForAll",
240
+ "outputs": [],
241
+ "payable": false,
242
+ "stateMutability": "nonpayable",
243
+ "type": "function"
244
+ },
245
+ {
246
+ "constant": false,
247
+ "inputs": [
248
+ {
249
+ "internalType": "bytes32",
250
+ "name": "node",
251
+ "type": "bytes32"
252
+ },
253
+ {
254
+ "internalType": "address",
255
+ "name": "owner",
256
+ "type": "address"
257
+ }
258
+ ],
259
+ "name": "setOwner",
260
+ "outputs": [],
261
+ "payable": false,
262
+ "stateMutability": "nonpayable",
263
+ "type": "function"
264
+ },
265
+ {
266
+ "constant": false,
267
+ "inputs": [
268
+ {
269
+ "internalType": "bytes32",
270
+ "name": "node",
271
+ "type": "bytes32"
272
+ },
273
+ {
274
+ "internalType": "address",
275
+ "name": "owner",
276
+ "type": "address"
277
+ },
278
+ {
279
+ "internalType": "address",
280
+ "name": "resolver",
281
+ "type": "address"
282
+ },
283
+ {
284
+ "internalType": "uint64",
285
+ "name": "ttl",
286
+ "type": "uint64"
287
+ }
288
+ ],
289
+ "name": "setRecord",
290
+ "outputs": [],
291
+ "payable": false,
292
+ "stateMutability": "nonpayable",
293
+ "type": "function"
294
+ },
295
+ {
296
+ "constant": false,
297
+ "inputs": [
298
+ {
299
+ "internalType": "bytes32",
300
+ "name": "node",
301
+ "type": "bytes32"
302
+ },
303
+ {
304
+ "internalType": "address",
305
+ "name": "resolver",
306
+ "type": "address"
307
+ }
308
+ ],
309
+ "name": "setResolver",
310
+ "outputs": [],
311
+ "payable": false,
312
+ "stateMutability": "nonpayable",
313
+ "type": "function"
314
+ },
315
+ {
316
+ "constant": false,
317
+ "inputs": [
318
+ {
319
+ "internalType": "bytes32",
320
+ "name": "node",
321
+ "type": "bytes32"
322
+ },
323
+ {
324
+ "internalType": "bytes32",
325
+ "name": "label",
326
+ "type": "bytes32"
327
+ },
328
+ {
329
+ "internalType": "address",
330
+ "name": "owner",
331
+ "type": "address"
332
+ }
333
+ ],
334
+ "name": "setSubnodeOwner",
335
+ "outputs": [
336
+ {
337
+ "internalType": "bytes32",
338
+ "name": "",
339
+ "type": "bytes32"
340
+ }
341
+ ],
342
+ "payable": false,
343
+ "stateMutability": "nonpayable",
344
+ "type": "function"
345
+ },
346
+ {
347
+ "constant": false,
348
+ "inputs": [
349
+ {
350
+ "internalType": "bytes32",
351
+ "name": "node",
352
+ "type": "bytes32"
353
+ },
354
+ {
355
+ "internalType": "bytes32",
356
+ "name": "label",
357
+ "type": "bytes32"
358
+ },
359
+ {
360
+ "internalType": "address",
361
+ "name": "owner",
362
+ "type": "address"
363
+ },
364
+ {
365
+ "internalType": "address",
366
+ "name": "resolver",
367
+ "type": "address"
368
+ },
369
+ {
370
+ "internalType": "uint64",
371
+ "name": "ttl",
372
+ "type": "uint64"
373
+ }
374
+ ],
375
+ "name": "setSubnodeRecord",
376
+ "outputs": [],
377
+ "payable": false,
378
+ "stateMutability": "nonpayable",
379
+ "type": "function"
380
+ },
381
+ {
382
+ "constant": false,
383
+ "inputs": [
384
+ {
385
+ "internalType": "bytes32",
386
+ "name": "node",
387
+ "type": "bytes32"
388
+ },
389
+ {
390
+ "internalType": "uint64",
391
+ "name": "ttl",
392
+ "type": "uint64"
393
+ }
394
+ ],
395
+ "name": "setTTL",
396
+ "outputs": [],
397
+ "payable": false,
398
+ "stateMutability": "nonpayable",
399
+ "type": "function"
400
+ },
401
+ {
402
+ "constant": true,
403
+ "inputs": [
404
+ {
405
+ "internalType": "bytes32",
406
+ "name": "node",
407
+ "type": "bytes32"
408
+ }
409
+ ],
410
+ "name": "ttl",
411
+ "outputs": [
412
+ {
413
+ "internalType": "uint64",
414
+ "name": "",
415
+ "type": "uint64"
416
+ }
417
+ ],
418
+ "payable": false,
419
+ "stateMutability": "view",
420
+ "type": "function"
421
+ }
422
+ ]
data/eth.gemspec CHANGED
@@ -28,11 +28,11 @@ Gem::Specification.new do |spec|
28
28
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
29
  spec.bindir = "exe"
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
- spec.require_paths = ["lib"]
31
+ spec.require_paths = ["lib", "abis"]
32
32
  spec.test_files = spec.files.grep %r{^(test|spec|features)/}
33
33
 
34
34
  spec.platform = Gem::Platform::RUBY
35
- spec.required_ruby_version = ">= 2.6", "< 4.0"
35
+ spec.required_ruby_version = ">= 2.7", "< 4.0"
36
36
 
37
37
  # keccak for hashing everything in ethereum
38
38
  spec.add_dependency "keccak", "~> 1.3"
data/lib/eth/abi/event.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016-2022 The Ruby-Eth Contributors
1
+ # Copyright (c) 2016-2023 The Ruby-Eth Contributors
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.