Class: Ethereum::Receipt

Inherits:
Object show all
Extended by:
Sedes
Includes:
RLP::Sedes::Serializable
Defined in:
lib/ethereum/receipt.rb

Instance Method Summary collapse

Methods included from Sedes

address, big_endian_int, binary, hash32, int20, int256, int32, trie_root

Constructor Details

#initialize(*args) ⇒ Receipt

initialize(state_root, gas_used, logs, bloom: nil)

Raises:

  • (ArgumentError)


17
18
19
20
21
# File 'lib/ethereum/receipt.rb', line 17

def initialize(*args)
  h = normalize_args args
  super(h)
  raise ArgumentError, "Invalid bloom filter" if h[:bloom] && h[:bloom] != self.bloom
end

Instance Method Details

#bloomObject



23
24
25
26
# File 'lib/ethereum/receipt.rb', line 23

def bloom
  bloomables = logs.map {|l| l.bloomables }
  Bloom.from_array bloomables.flatten
end