mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Refactor buffer constructor (#5468)
This commit is contained in:
parent
012f7ddd72
commit
ebdefe81a1
@ -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…
Reference in New Issue
Block a user