class Etherlite::Contract::EventBase

Attributes

address[R]
attributes[R]
block_hash[R]
block_number[R]
tx_hash[R]

Public Class Methods

decode(_connection, _json) click to toggle source
# File lib/etherlite/contract/event_base.rb, line 24
def self.decode(_connection, _json)
  new(
    _json['blockHash'],
    _json['blockNumber'].nil? ? nil : Etherlite::Utils.hex_to_uint(_json['blockNumber']),
    _json['transactionHash'],
    Etherlite::Address.new(_connection, Etherlite::Utils.normalize_address(_json['address'])),
    DecodeLogInputs.for(connection: _connection, inputs: inputs, json: _json)
  )
end
inputs() click to toggle source
# File lib/etherlite/contract/event_base.rb, line 5
def self.inputs
  nil # To be implemented by sub classes
end
new(_block_hash, _block_number, _tx_hash, _address, _attributes) click to toggle source
# File lib/etherlite/contract/event_base.rb, line 36
def initialize(_block_hash, _block_number, _tx_hash, _address, _attributes)
  @block_hash = _block_hash
  @block_number = _block_number
  @tx_hash = _tx_hash
  @address = _address
  @attributes = _attributes
end
original_name() click to toggle source
# File lib/etherlite/contract/event_base.rb, line 9
def self.original_name
  nil # To be implemented by sub classes
end
signature() click to toggle source
# File lib/etherlite/contract/event_base.rb, line 13
def self.signature
  @signature ||= begin
    input_sig = inputs.map { |i| i.type.signature }
    "#{original_name}(#{input_sig.join(',')})"
  end
end
topic() click to toggle source
# File lib/etherlite/contract/event_base.rb, line 20
def self.topic
  '0x' + Etherlite::Utils.sha3(signature)
end