-
Notifications
You must be signed in to change notification settings - Fork 8
/
hookIntoEvents.patch
31 lines (27 loc) · 1.06 KB
/
hookIntoEvents.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- opFns.js.orig 2016-12-19 15:10:12.000000000 -0800
+++ opFns.js 2016-12-19 15:15:51.000000000 -0800
@@ -6,6 +6,7 @@
const logTable = require('./logTable.js')
const ERROR = constants.ERROR
const MAX_INT = 9007199254740991
+const fs = require('fs');
// the opcode functions
module.exports = {
@@ -489,7 +490,7 @@
memLength = utils.bufferToInt(memLength)
const numOfTopics = runState.opCode - 0xa0
const mem = memLoad(runState, memOffset, memLength)
- subGas(runState, new BN(numOfTopics * fees.logTopicGas.v + memLength * fees.logDataGas.v))
+ //subGas(runState, new BN(numOfTopics * fees.logTopicGas.v + memLength * fees.logDataGas.v))
// add address
var log = [runState.address]
@@ -497,6 +498,11 @@
// add data
log.push(mem)
+ var toWrite = {};
+ toWrite.address= log[0].toString('hex')
+ toWrite.topics = log[1].map(function(x){return x.toString('hex')})
+ toWrite.data = log[2].toString('hex')
+ fs.appendFileSync('./allFiredEvents', JSON.stringify(toWrite) + '\n')
runState.logs.push(log)
},