def revert(mysnapshot)
      logger.debug "REVERTING"

      @journal = mysnapshot[:journal]
      # if @journal changed after snapshot
      while @journal.size > mysnapshot[:journal_size]
        cache, index, prev, post = @journal.pop
        logger.debug "revert journal", cache: cache, index: index, prev: prev, post: post
        if prev
          @caches[cache][index] = prev
        else
          @caches[cache].delete index
        end
      end

      self.suicides = mysnapshot[:suicides]
      suicides.pop while suicides.size > mysnapshot[:suicides_size]

      self.logs = mysnapshot[:logs]
      logs.pop while logs.size > mysnapshot[:logs_size]

      self.refunds = mysnapshot[:refunds]
      self.gas_used = mysnapshot[:gas]
      self.ether_delta = mysnapshot[:ether_delta]

      @transactions = mysnapshot[:txs]
      @transaction_count = mysnapshot[:txcount]

      @state.set_root_hash mysnapshot[:state]

      @get_transactions_cache = []
    end
def revert(mysnapshot)
      logger.debug "REVERTING"

      @journal = mysnapshot[:journal]
      # if @journal changed after snapshot
      while @journal.size > mysnapshot[:journal_size]
        cache, index, prev, post = @journal.pop
        logger.debug "revert journal", cache: cache, index: index, prev: prev, post: post
        if prev
          @caches[cache][index] = prev
        else
          @caches[cache].delete index
        end
      end

      self.suicides = mysnapshot[:suicides]
      suicides.pop while suicides.size > mysnapshot[:suicides_size]

      self.logs = mysnapshot[:logs]
      logs.pop while logs.size > mysnapshot[:logs_size]

      self.refunds = mysnapshot[:refunds]
      self.gas_used = mysnapshot[:gas]
      self.ether_delta = mysnapshot[:ether_delta]

      @transactions = mysnapshot[:txs]
      @transaction_count = mysnapshot[:txcount]

      @state.set_root_hash mysnapshot[:state]

      @get_transactions_cache = []
    end
Revert to a previously made snapshot.

 Reverting is for example neccessary when a contract runs out of gas
 during execution.