Skip to content

Commit f452ae9

Browse files
authored
Merge pull request ethereumjs#405 from pinkiebell/runState
runCode: Add `memoryWordCount` to the `step` event object.
2 parents 8ef17c8 + 3677829 commit f452ae9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Type: [Object][29]
199199
- `address` **[Buffer][42]** the address of the `account`
200200
- `depth` **[Number][32]** the current number of calls deep the contract is
201201
- `memory` **[Buffer][42]** the memory of the VM as a `buffer`
202+
- `memoryWordCount` **BN** current size of memory in words
202203
- `stateManager` **StateManager** a [`StateManager`][30] instance (Beta API)
203204

204205
[1]: #vmrunblockchain

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)