Refactor buffer constructor (#5468)

feature/default_network_editable
Noel Yoo 6 years ago committed by Whymarrh Whitby
parent 012f7ddd72
commit ebdefe81a1
  1. 2
      app/scripts/lib/message-manager.js
  2. 2
      app/scripts/lib/personal-message-manager.js
  3. 2
      test/lib/mock-encryptor.js
  4. 2
      test/unit/components/binary-renderer-test.js

@ -272,6 +272,6 @@ function normalizeMsgData (data) {
return data
} else {
// data is unicode, convert to hex
return ethUtil.bufferToHex(new Buffer(data, 'utf8'))
return ethUtil.bufferToHex(Buffer.from(data, 'utf8'))
}
}

@ -285,7 +285,7 @@ module.exports = class PersonalMessageManager extends EventEmitter {
log.debug(`Message was not hex encoded, interpreting as utf8.`)
}
return ethUtil.bufferToHex(new Buffer(data, 'utf8'))
return ethUtil.bufferToHex(Buffer.from(data, 'utf8'))
}
}

@ -1,5 +1,5 @@
var mockHex = '0xabcdef0123456789'
var mockKey = new Buffer(32)
var mockKey = Buffer.alloc(32)
let cacheVal
module.exports = {

@ -4,7 +4,7 @@ var BinaryRenderer = require('../../../old-ui/app/components/binary-renderer')
describe('BinaryRenderer', function () {
let binaryRenderer
const message = 'Hello, world!'
const buffer = new Buffer(message, 'utf8')
const buffer = Buffer.from(message, 'utf8')
const hex = buffer.toString('hex')
beforeEach(function () {

Loading…
Cancel
Save