Method: Ethereum::Block#set_storage_data

Defined in:
lib/ethereum/block.rb

#set_storage_data(address, index, value) ⇒ Object

Set a specific item in the storage of an account.

Parameters:

  • address (String)

    the address of the account (binary or hex string)

  • index (Integer)

    the index of the requested item in the storage

  • value (Integer)

    the new value of the item



993
994
995
996
997
998
999
1000
1001
1002
1003
# File 'lib/ethereum/block.rb', line 993

def set_storage_data(address, index, value)
  address = Utils.normalize_address address

  cache_key = "storage:#{address}"
  unless @caches.has_key?(cache_key)
    @caches[cache_key] = {}
    set_and_journal :all, address, true
  end

  set_and_journal cache_key, index, value
end