eth 0.5.0 → 0.5.3
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 +4 -4
- data/.github/workflows/codeql.yml +4 -0
- data/.github/workflows/spec.yml +14 -3
- data/.yardopts +1 -0
- data/AUTHORS.txt +14 -1
- data/CHANGELOG.md +63 -13
- data/README.md +121 -18
- data/bin/console +2 -1
- data/bin/setup +3 -4
- data/codecov.yml +6 -0
- data/eth.gemspec +5 -7
- data/lib/eth/abi/event.rb +137 -0
- data/lib/eth/abi/type.rb +8 -7
- data/lib/eth/abi.rb +29 -11
- data/lib/eth/address.rb +12 -5
- data/lib/eth/api.rb +223 -0
- data/lib/eth/chain.rb +31 -28
- data/lib/eth/client/http.rb +63 -0
- data/lib/eth/client/ipc.rb +50 -0
- data/lib/eth/client.rb +468 -0
- data/lib/eth/constant.rb +71 -0
- data/lib/eth/contract/event.rb +41 -0
- data/lib/eth/contract/function.rb +56 -0
- data/lib/eth/contract/function_input.rb +36 -0
- data/lib/eth/contract/function_output.rb +32 -0
- data/lib/eth/contract/initializer.rb +46 -0
- data/lib/eth/contract.rb +120 -0
- data/lib/eth/eip712.rb +2 -2
- data/lib/eth/key/decrypter.rb +16 -13
- data/lib/eth/key/encrypter.rb +27 -25
- data/lib/eth/key.rb +21 -16
- data/lib/eth/rlp/decoder.rb +114 -0
- data/lib/eth/rlp/encoder.rb +78 -0
- data/lib/eth/rlp/sedes/big_endian_int.rb +66 -0
- data/lib/eth/rlp/sedes/binary.rb +97 -0
- data/lib/eth/rlp/sedes/list.rb +84 -0
- data/lib/eth/rlp/sedes.rb +74 -0
- data/lib/eth/rlp.rb +63 -0
- data/lib/eth/signature.rb +11 -8
- data/lib/eth/solidity.rb +75 -0
- data/lib/eth/tx/eip1559.rb +22 -14
- data/lib/eth/tx/eip2930.rb +23 -15
- data/lib/eth/tx/legacy.rb +14 -10
- data/lib/eth/tx.rb +28 -34
- data/lib/eth/unit.rb +1 -1
- data/lib/eth/util.rb +68 -11
- data/lib/eth/version.rb +3 -3
- data/lib/eth.rb +15 -2
- metadata +31 -23
- data/lib/eth/abi/constant.rb +0 -63
data/lib/eth/abi/constant.rb
DELETED
@@ -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
|