etherlite 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/etherlite/api/node.rb +13 -0
- data/lib/etherlite/contract/event_base.rb +4 -2
- data/lib/etherlite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bf8a9190a5d68f31c167f12420cb5cfe001948a
|
4
|
+
data.tar.gz: eefb160572438cce6b6b8102fe99dbf07b10e75c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ba2cd039eaa83fd38530121c84f67410274f0bd5942ccf72f146731f9669fef510b6fd1bc26d9dcc969468c56dfdc13930744ce3b8e13494a6bd064947a06cd
|
7
|
+
data.tar.gz: fc0c14e3706e38cc03d223731d673c133e6b5f7688da1dfd202683000c334e17deabac7366ffa2ff7a00f4178137f8eab3b5e5c09096a68561935b1b8d052787
|
data/lib/etherlite/api/node.rb
CHANGED
@@ -16,6 +16,19 @@ module Etherlite
|
|
16
16
|
load_transaction(*_args).refresh
|
17
17
|
end
|
18
18
|
|
19
|
+
def get_logs(events: nil, address: nil, from_block: :earliest, to_block: :latest)
|
20
|
+
params = {
|
21
|
+
fromBlock: Etherlite::Utils.encode_block_param(from_block),
|
22
|
+
toBlock: Etherlite::Utils.encode_block_param(to_block)
|
23
|
+
}
|
24
|
+
|
25
|
+
params[:topics] = [Array(events).map(&:topic)] unless events.nil?
|
26
|
+
params[:address] = Etherlite::Utils.encode_address_param(address) unless address.nil?
|
27
|
+
|
28
|
+
logs = connection.ipc_call(:eth_getLogs, params)
|
29
|
+
::Etherlite::EventProvider.parse_raw_logs(connection, logs)
|
30
|
+
end
|
31
|
+
|
19
32
|
def load_transaction(_hash)
|
20
33
|
Transaction.new(connection, _hash)
|
21
34
|
end
|
@@ -25,15 +25,17 @@ module Etherlite::Contract
|
|
25
25
|
new(
|
26
26
|
_json['blockNumber'].nil? ? nil : Etherlite::Utils.hex_to_uint(_json['blockNumber']),
|
27
27
|
_json['transactionHash'],
|
28
|
+
Etherlite::Address.new(_connection, Etherlite::Utils.normalize_address(_json['address'])),
|
28
29
|
DecodeLogInputs.for(connection: _connection, inputs: inputs, json: _json)
|
29
30
|
)
|
30
31
|
end
|
31
32
|
|
32
|
-
attr_reader :block_number, :tx_hash, :attributes
|
33
|
+
attr_reader :block_number, :tx_hash, :address, :attributes
|
33
34
|
|
34
|
-
def initialize(_block_number, _tx_hash, _attributes)
|
35
|
+
def initialize(_block_number, _tx_hash, _address, _attributes)
|
35
36
|
@block_number = _block_number
|
36
37
|
@tx_hash = _tx_hash
|
38
|
+
@address = _address
|
37
39
|
@attributes = _attributes
|
38
40
|
end
|
39
41
|
end
|
data/lib/etherlite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etherlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignacio Baixas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: digest-sha3
|