rename resolveStorage => accumulateStorageChanges

pull/7/head
yann300 8 years ago
parent 097a0a4a09
commit 16ea5a9353
  1. 6
      src/storage/storageResolver.js
  2. 2
      src/trace/traceCache.js
  3. 4
      src/trace/traceManager.js
  4. 4
      test/traceManager.js

@ -57,7 +57,7 @@ class StorageResolver {
}
/**
* resolve the storage to the specified execution step @arg index. uses the traceManager.resolveStorage
* resolve the storage to the specified execution step @arg index. uses the traceManager.accumulateStorageChanges
*
* @param {Int} index - execution step index
* @param {String} address - contract address
@ -65,8 +65,8 @@ class StorageResolver {
* @param {Int} stepIndex - vm trave index
* @return {Map} - The storage resolved to the given exection point
*/
resolveStorage (stepIndex, address, storage, callback) {
this.traceManager.resolveStorage(stepIndex, address, storage, callback)
accumulateStorageChanges (stepIndex, address, storage, callback) {
this.traceManager.accumulateStorageChanges(stepIndex, address, storage, callback)
}
}

@ -92,7 +92,7 @@ TraceCache.prototype.pushStoreChanges = function (index, address, key, value) {
this.storageChanges.push(index)
}
TraceCache.prototype.resolveStorage = function (index, address, storage) {
TraceCache.prototype.accumulateStorageChanges = function (index, address, storage) {
var ret = Object.assign({}, storage)
for (var k in this.storageChanges) {
var changesIndex = this.storageChanges[k]

@ -74,8 +74,8 @@ TraceManager.prototype.getLength = function (callback) {
}
}
TraceManager.prototype.resolveStorage = function (index, address, storageOrigin, callback) {
var storage = this.traceCache.resolveStorage(index, address, storageOrigin)
TraceManager.prototype.accumulateStorageChanges = function (index, address, storageOrigin, callback) {
var storage = this.traceCache.accumulateStorageChanges(index, address, storageOrigin)
callback(null, storage)
}

@ -53,8 +53,8 @@ tape('TraceManager', function (t) {
st.end()
})
t.test('TraceManager.resolveStorage', function (st) {
traceManager.resolveStorage(110, '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', {}, function (error, result) {
t.test('TraceManager.accumulateStorageChanges', function (st) {
traceManager.accumulateStorageChanges(110, '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', {}, function (error, result) {
if (error) {
st.fail(error)
} else {

Loading…
Cancel
Save