Skip to content

Commit 8121278

Browse files
committed
runCode: Add memoryWordCount to the step event object.
If a user modifies memory like shrinking and growing, he also needs access to this property to reflect memory size changes.
1 parent 8ef17c8 commit 8121278

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/runCode.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ module.exports = function (opts, cb) {
152152
address: runState.address,
153153
account: runState.contract,
154154
stateManager: runState.stateManager,
155-
memory: runState.memory
155+
memory: runState.memory,
156+
memoryWordCount: runState.memoryWordCount
156157
}
157158
/**
158159
* The `step` event for trace output
@@ -167,6 +168,7 @@ module.exports = function (opts, cb) {
167168
* @property {Buffer} address the address of the `account`
168169
* @property {Number} depth the current number of calls deep the contract is
169170
* @property {Buffer} memory the memory of the VM as a `buffer`
171+
* @property {BN} memoryWordCount current size of memory in words
170172
* @property {StateManager} stateManager a [`StateManager`](stateManager.md) instance (Beta API)
171173
*/
172174
self.emit('step', eventObj, cb)

0 commit comments

Comments
 (0)