Last active
December 7, 2018 16:17
-
-
Save shadowcodex/cf7189d18e366a27772cf58330ea6afb to your computer and use it in GitHub Desktop.
Fix Web3 for timestamp overflow.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = "node_modules/web3-core-helpers/src/formatters.js"; | |
if (fs.existsSync(path)) { | |
fs.readFile(path, "utf8", (err, data) => { | |
if (err) { | |
return console.error(err); | |
} | |
const result = data.replace( | |
/block\.timestamp \= utils\.hexToNumber\(/gm, | |
"block.timestamp = utils.hexToNumberString(", | |
); | |
fs.writeFile(path, result, "utf8", err => { | |
if (err) return console.error(err); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment