|
|
@ -11,6 +11,7 @@ class StorageViewer { |
|
|
|
constructor (_context, _storageResolver, _traceManager) { |
|
|
|
constructor (_context, _storageResolver, _traceManager) { |
|
|
|
this.context = _context |
|
|
|
this.context = _context |
|
|
|
this.storageResolver = _storageResolver |
|
|
|
this.storageResolver = _storageResolver |
|
|
|
|
|
|
|
this.completeMapingsLocationPromise = null |
|
|
|
_traceManager.accumulateStorageChanges(this.context.stepIndex, this.context.address, {}, (error, storageChanges) => { |
|
|
|
_traceManager.accumulateStorageChanges(this.context.stepIndex, this.context.address, {}, (error, storageChanges) => { |
|
|
|
if (!error) { |
|
|
|
if (!error) { |
|
|
|
this.storageChanges = storageChanges |
|
|
|
this.storageChanges = storageChanges |
|
|
@ -71,9 +72,10 @@ class StorageViewer { |
|
|
|
* @param {Function} callback |
|
|
|
* @param {Function} callback |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
async mappingsLocation () { |
|
|
|
async mappingsLocation () { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if (!this.completeMapingsLocationPromise) { |
|
|
|
|
|
|
|
this.completeMapingsLocationPromise = new Promise((resolve, reject) => { |
|
|
|
if (this.completeMappingsLocation) { |
|
|
|
if (this.completeMappingsLocation) { |
|
|
|
return resolve(this.completeMappingsLocation) |
|
|
|
return this.completeMappingsLocation |
|
|
|
} |
|
|
|
} |
|
|
|
this.storageResolver.initialPreimagesMappings(this.context.tx, this.context.stepIndex, this.context.address, (error, initialMappingsLocation) => { |
|
|
|
this.storageResolver.initialPreimagesMappings(this.context.tx, this.context.stepIndex, this.context.address, (error, initialMappingsLocation) => { |
|
|
|
if (error) { |
|
|
|
if (error) { |
|
|
@ -96,6 +98,8 @@ class StorageViewer { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return this.completeMapingsLocationPromise |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* retrieve mapping location changes from the storage changes. |
|
|
|
* retrieve mapping location changes from the storage changes. |
|
|
|