diff --git a/remix-debug/test/decoder/localDecoder.js b/remix-debug/test/decoder/localDecoder.js index 53d5006a46..21c45e17ee 100644 --- a/remix-debug/test/decoder/localDecoder.js +++ b/remix-debug/test/decoder/localDecoder.js @@ -14,7 +14,7 @@ var compilerInput = remixLib.helpers.compiler.compilerInput tape('solidity', function (t) { t.test('local decoder', function (st) { - var privateKey = new Buffer('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') + var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var vm = vmCall.initVM(st, privateKey) test(st, vm, privateKey) }) diff --git a/remix-debug/test/decoder/stateTests/mapping.js b/remix-debug/test/decoder/stateTests/mapping.js index 28709c7903..5a25368642 100644 --- a/remix-debug/test/decoder/stateTests/mapping.js +++ b/remix-debug/test/decoder/stateTests/mapping.js @@ -11,7 +11,7 @@ var StorageViewer = require('../../../src/storage/storageViewer') module.exports = function testMappingStorage (st, cb) { var mappingStorage = require('../contracts/mappingStorage') - var privateKey = new Buffer('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') + var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var vm = vmCall.initVM(st, privateKey) var output = compiler.compileStandardWrapper(compilerInput(mappingStorage.contract)) output = JSON.parse(output) diff --git a/remix-debug/test/decoder/vmCall.js b/remix-debug/test/decoder/vmCall.js index a57e3114c5..a1ee34a634 100644 --- a/remix-debug/test/decoder/vmCall.js +++ b/remix-debug/test/decoder/vmCall.js @@ -12,7 +12,7 @@ function sendTx (vm, from, to, value, data, cb) { gasLimit: new BN(3000000, 10), to: to, value: new BN(value, 10), - data: new Buffer(data, 'hex') + data: Buffer.from(data, 'hex') }) tx.sign(from.privateKey) var block = new Block({ diff --git a/remix-debug/test/tests.js b/remix-debug/test/tests.js index 0ae683aac2..01817ce5cd 100644 --- a/remix-debug/test/tests.js +++ b/remix-debug/test/tests.js @@ -15,7 +15,7 @@ var BreakpointManager = remixLib.code.BreakpointManager tape('debug contract', function (t) { t.plan(12) - var privateKey = new Buffer('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') + var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var vm = vmCall.initVM(t, privateKey) var output = compiler.compileStandardWrapper(compilerInput(ballot)) output = JSON.parse(output) diff --git a/remix-debug/test/vmCall.js b/remix-debug/test/vmCall.js index a57e3114c5..a1ee34a634 100644 --- a/remix-debug/test/vmCall.js +++ b/remix-debug/test/vmCall.js @@ -12,7 +12,7 @@ function sendTx (vm, from, to, value, data, cb) { gasLimit: new BN(3000000, 10), to: to, value: new BN(value, 10), - data: new Buffer(data, 'hex') + data: Buffer.from(data, 'hex') }) tx.sign(from.privateKey) var block = new Block({ diff --git a/remix-lib/src/code/codeResolver.js b/remix-lib/src/code/codeResolver.js index 87902cc3c2..363fb5aaff 100644 --- a/remix-lib/src/code/codeResolver.js +++ b/remix-lib/src/code/codeResolver.js @@ -48,7 +48,7 @@ CodeResolver.prototype.cacheExecutingCode = function (address, hexCode) { } CodeResolver.prototype.formatCode = function (hexCode) { - var code = codeUtils.nameOpCodes(new Buffer(hexCode.substring(2), 'hex')) + var code = codeUtils.nameOpCodes(Buffer.from(hexCode.substring(2), 'hex')) return { code: code[0], instructionsIndexByBytesOffset: code[1] diff --git a/remix-lib/src/execution/eventsDecoder.js b/remix-lib/src/execution/eventsDecoder.js index 1cd79ac72d..a0a3b5123c 100644 --- a/remix-lib/src/execution/eventsDecoder.js +++ b/remix-lib/src/execution/eventsDecoder.js @@ -42,7 +42,7 @@ class EventsDecoder { var abi = new ethers.Interface(contract.abi) for (var e in abi.events) { var event = abi.events[e] - eventABI[ethJSUtil.sha3(new Buffer(event.signature)).toString('hex')] = { event: event.name, inputs: event.inputs, object: event } + eventABI[ethJSUtil.sha3(Buffer.from(event.signature)).toString('hex')] = { event: event.name, inputs: event.inputs, object: event } } return eventABI } diff --git a/remix-lib/src/execution/txRunner.js b/remix-lib/src/execution/txRunner.js index 48712bddb6..dad77bdc6a 100644 --- a/remix-lib/src/execution/txRunner.js +++ b/remix-lib/src/execution/txRunner.js @@ -100,7 +100,7 @@ class TxRunner { gasLimit: new BN(gasLimit, 10), to: to, value: new BN(value, 10), - data: new Buffer(data.slice(2), 'hex') + data: Buffer.from(data.slice(2), 'hex') }) tx.sign(account.privateKey) @@ -133,7 +133,7 @@ class TxRunner { } callback(err, { result: result, - transactionHash: ethJSUtil.bufferToHex(new Buffer(tx.hash())) + transactionHash: ethJSUtil.bufferToHex(Buffer.from(tx.hash())) }) }) }