Class: Etherlite::Contract::EventBase
- Inherits:
-
Object
- Object
- Etherlite::Contract::EventBase
- Defined in:
- lib/etherlite/contract/event_base.rb,
lib/etherlite/commands/contract/event_base/decode_log_inputs.rb
Defined Under Namespace
Classes: DecodeLogInputs
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#block_hash ⇒ Object
readonly
Returns the value of attribute block_hash.
-
#block_number ⇒ Object
readonly
Returns the value of attribute block_number.
-
#tx_hash ⇒ Object
readonly
Returns the value of attribute tx_hash.
Class Method Summary collapse
- .decode(_connection, _json) ⇒ Object
- .inputs ⇒ Object
- .original_name ⇒ Object
- .signature ⇒ Object
- .topic ⇒ Object
Instance Method Summary collapse
-
#initialize(_block_hash, _block_number, _tx_hash, _address, _attributes) ⇒ EventBase
constructor
A new instance of EventBase.
Constructor Details
#initialize(_block_hash, _block_number, _tx_hash, _address, _attributes) ⇒ EventBase
Returns a new instance of EventBase.
36 37 38 39 40 41 42 |
# 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 |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
34 35 36 |
# File 'lib/etherlite/contract/event_base.rb', line 34 def address @address end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
34 35 36 |
# File 'lib/etherlite/contract/event_base.rb', line 34 def attributes @attributes end |
#block_hash ⇒ Object (readonly)
Returns the value of attribute block_hash.
34 35 36 |
# File 'lib/etherlite/contract/event_base.rb', line 34 def block_hash @block_hash end |
#block_number ⇒ Object (readonly)
Returns the value of attribute block_number.
34 35 36 |
# File 'lib/etherlite/contract/event_base.rb', line 34 def block_number @block_number end |
#tx_hash ⇒ Object (readonly)
Returns the value of attribute tx_hash.
34 35 36 |
# File 'lib/etherlite/contract/event_base.rb', line 34 def tx_hash @tx_hash end |
Class Method Details
.decode(_connection, _json) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# 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 ⇒ Object
5 6 7 |
# File 'lib/etherlite/contract/event_base.rb', line 5 def self.inputs nil # To be implemented by sub classes end |
.original_name ⇒ Object
9 10 11 |
# File 'lib/etherlite/contract/event_base.rb', line 9 def self.original_name nil # To be implemented by sub classes end |
.signature ⇒ Object
13 14 15 16 17 18 |
# 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 |