eth 0.5.0 → 0.5.3

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 +4 -0
  3. data/.github/workflows/spec.yml +14 -3
  4. data/.yardopts +1 -0
  5. data/AUTHORS.txt +14 -1
  6. data/CHANGELOG.md +63 -13
  7. data/README.md +121 -18
  8. data/bin/console +2 -1
  9. data/bin/setup +3 -4
  10. data/codecov.yml +6 -0
  11. data/eth.gemspec +5 -7
  12. data/lib/eth/abi/event.rb +137 -0
  13. data/lib/eth/abi/type.rb +8 -7
  14. data/lib/eth/abi.rb +29 -11
  15. data/lib/eth/address.rb +12 -5
  16. data/lib/eth/api.rb +223 -0
  17. data/lib/eth/chain.rb +31 -28
  18. data/lib/eth/client/http.rb +63 -0
  19. data/lib/eth/client/ipc.rb +50 -0
  20. data/lib/eth/client.rb +468 -0
  21. data/lib/eth/constant.rb +71 -0
  22. data/lib/eth/contract/event.rb +41 -0
  23. data/lib/eth/contract/function.rb +56 -0
  24. data/lib/eth/contract/function_input.rb +36 -0
  25. data/lib/eth/contract/function_output.rb +32 -0
  26. data/lib/eth/contract/initializer.rb +46 -0
  27. data/lib/eth/contract.rb +120 -0
  28. data/lib/eth/eip712.rb +2 -2
  29. data/lib/eth/key/decrypter.rb +16 -13
  30. data/lib/eth/key/encrypter.rb +27 -25
  31. data/lib/eth/key.rb +21 -16
  32. data/lib/eth/rlp/decoder.rb +114 -0
  33. data/lib/eth/rlp/encoder.rb +78 -0
  34. data/lib/eth/rlp/sedes/big_endian_int.rb +66 -0
  35. data/lib/eth/rlp/sedes/binary.rb +97 -0
  36. data/lib/eth/rlp/sedes/list.rb +84 -0
  37. data/lib/eth/rlp/sedes.rb +74 -0
  38. data/lib/eth/rlp.rb +63 -0
  39. data/lib/eth/signature.rb +11 -8
  40. data/lib/eth/solidity.rb +75 -0
  41. data/lib/eth/tx/eip1559.rb +22 -14
  42. data/lib/eth/tx/eip2930.rb +23 -15
  43. data/lib/eth/tx/legacy.rb +14 -10
  44. data/lib/eth/tx.rb +28 -34
  45. data/lib/eth/unit.rb +1 -1
  46. data/lib/eth/util.rb +68 -11
  47. data/lib/eth/version.rb +3 -3
  48. data/lib/eth.rb +15 -2
  49. metadata +31 -23
  50. data/lib/eth/abi/constant.rb +0 -63
@@ -1,63 +0,0 @@
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
- # -*- encoding : ascii-8bit -*-
16
-
17
- # Provides the `Eth` module.
18
- module Eth
19
-
20
- # Provides a Ruby implementation of the Ethereum Applicatoin Binary Interface (ABI).
21
- module Abi
22
-
23
- # Provides commonly used constants, such as zero bytes or zero keys.
24
- module Constant
25
-
26
- # The empty byte is defined as "".
27
- BYTE_EMPTY = "".freeze
28
-
29
- # The zero byte is 0x00.
30
- BYTE_ZERO = "\x00".freeze
31
-
32
- # The byte one is 0x01.
33
- BYTE_ONE = "\x01".freeze
34
-
35
- # The size of a 32-bit number.
36
- TT32 = (2 ** 32).freeze
37
-
38
- # The size of a 256-bit number.
39
- TT256 = (2 ** 256).freeze
40
-
41
- # The maximum possible value of an UInt256.
42
- UINT_MAX = (2 ** 256 - 1).freeze
43
-
44
- # The minimum possible value of an UInt256.
45
- UINT_MIN = 0.freeze
46
-
47
- # The maximum possible value of an Int256.
48
- INT_MAX = (2 ** 255 - 1).freeze
49
-
50
- # The minimum possible value of an Int256.
51
- INT_MIN = (-2 ** 255).freeze
52
-
53
- # A hash containing only zeros.
54
- HASH_ZERO = ("\x00" * 32).freeze
55
-
56
- # A private key containing only zeros.
57
- PRIVKEY_ZERO = ("\x00" * 32).freeze
58
-
59
- # A private key containing only zeros (hex).
60
- PRIVKEY_ZERO_HEX = ("0" * 64).freeze
61
- end
62
- end
63
- end