Class: Ethereum::VM::State

Inherits:
Object show all
Defined in:
lib/ethereum/vm/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ State



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ethereum/vm/state.rb', line 9

def initialize(**kwargs)
  @memory = []
  @stack = []
  @pc = 0
  @gas = 0

  kwargs.each do |k,v|
    class <<self
      self
    end.class_eval("attr_accessor :#{k}")
    send :"#{k}=", v
  end
end

Instance Attribute Details

#gasObject

Returns the value of attribute gas.



7
8
9
# File 'lib/ethereum/vm/state.rb', line 7

def gas
  @gas
end

#memoryObject

Returns the value of attribute memory.



7
8
9
# File 'lib/ethereum/vm/state.rb', line 7

def memory
  @memory
end

#pcObject

Returns the value of attribute pc.



7
8
9
# File 'lib/ethereum/vm/state.rb', line 7

def pc
  @pc
end

#stackObject

Returns the value of attribute stack.



7
8
9
# File 'lib/ethereum/vm/state.rb', line 7

def stack
  @stack
end