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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18f870e66bfef56ad2be8131e3f82b094ba818af
4
- data.tar.gz: 6699c8e16b0a0e97483c38d4cf6bd78f40c59350
3
+ metadata.gz: 7bf8a9190a5d68f31c167f12420cb5cfe001948a
4
+ data.tar.gz: eefb160572438cce6b6b8102fe99dbf07b10e75c
5
5
  SHA512:
6
- metadata.gz: dfe39a5194f3fe5ea70c73078f598591605713ad531087bc94b38569e3d2ab7d0b637821a609b4badd3d55094e69c2297479319829c5ad01840f9bebb543db40
7
- data.tar.gz: d2b198d536856d28cf7f94c407b1368ba0bf657baed0cbabfaed8c522871d214ca596df2c778c785f79dcbe72074539f9e4b1a9ae776c1864259f5e95fd92ac8
6
+ metadata.gz: 0ba2cd039eaa83fd38530121c84f67410274f0bd5942ccf72f146731f9669fef510b6fd1bc26d9dcc969468c56dfdc13930744ce3b8e13494a6bd064947a06cd
7
+ data.tar.gz: fc0c14e3706e38cc03d223731d673c133e6b5f7688da1dfd202683000c334e17deabac7366ffa2ff7a00f4178137f8eab3b5e5c09096a68561935b1b8d052787
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Etherlite
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
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
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-19 00:00:00.000000000 Z
11
+ date: 2018-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: digest-sha3