Class: Eth::Abi::Event::LogDescription
- Inherits:
-
Object
- Object
- Eth::Abi::Event::LogDescription
- Defined in:
- lib/eth/abi/event.rb
Overview
A decoded event log.
Instance Attribute Summary collapse
-
#args ⇒ Object
The the input argument of the event.
-
#event_interface ⇒ Object
The event ABI interface used to decode the log.
-
#kwargs ⇒ Object
The named input argument of the event.
-
#topic ⇒ Object
The topic hash.
Instance Method Summary collapse
-
#initialize(event_interface, log) ⇒ LogDescription
constructor
Decodes event log argument values.
-
#name ⇒ Object
The event name.
-
#signature ⇒ Object
The event signature.
Constructor Details
#initialize(event_interface, log) ⇒ LogDescription
Decodes event log argument values.
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/eth/abi/event.rb', line 79 def initialize(event_interface, log) @event_interface = event_interface inputs = event_interface.fetch("inputs") data = log.fetch("data") topics = log.fetch("topics", []) anonymous = event_interface.fetch("anonymous", false) @topic = topics[0] if !anonymous @args, @kwargs = Event.decode_log(inputs, data, topics, anonymous) end |
Instance Attribute Details
#args ⇒ Object
The the input argument of the event.
67 68 69 |
# File 'lib/eth/abi/event.rb', line 67 def args @args end |
#event_interface ⇒ Object
The event ABI interface used to decode the log.
64 65 66 |
# File 'lib/eth/abi/event.rb', line 64 def event_interface @event_interface end |
#kwargs ⇒ Object
The named input argument of the event.
70 71 72 |
# File 'lib/eth/abi/event.rb', line 70 def kwargs @kwargs end |
#topic ⇒ Object
The topic hash.
73 74 75 |
# File 'lib/eth/abi/event.rb', line 73 def topic @topic end |
Instance Method Details
#name ⇒ Object
The event name. (e.g. Transfer)
92 93 94 |
# File 'lib/eth/abi/event.rb', line 92 def name @name ||= event_interface.fetch("name") end |