From 60c9ebaaf788afe5ad32efbac394dbeef2c2aa1f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 22 Mar 2016 23:56:01 +0000 Subject: [PATCH] Use ethutil.bufferToHex --- index.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index ed69af4..282456d 100644 --- a/index.js +++ b/index.js @@ -35,7 +35,7 @@ Wallet.prototype.getPrivateKey = function () { } Wallet.prototype.getPrivateKeyString = function () { - return '0x' + this.getPrivateKey().toString('hex') + return ethUtil.bufferToHex(this.getPrivateKey()) } Wallet.prototype.getPublicKey = function () { @@ -43,7 +43,7 @@ Wallet.prototype.getPublicKey = function () { } Wallet.prototype.getPublicKeyString = function () { - return '0x' + this.getPublicKey().toString('hex') + return ethUtil.bufferToHex(this.getPublicKey()) } Wallet.prototype.getAddress = function () { @@ -51,7 +51,7 @@ Wallet.prototype.getAddress = function () { } Wallet.prototype.getAddressString = function () { - return '0x' + this.getAddress().toString('hex') + return ethUtil.bufferToHex(this.getAddress()) } Wallet.prototype.getChecksumAddressString = function () { diff --git a/package.json b/package.json index 1dd6823..b20083e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "homepage": "https://github.com/axic/ethereumjs-wallet", "dependencies": { "aes-js": "^0.2.3", - "ethereumjs-util": "^4.1.0", + "ethereumjs-util": "^4.2.0", "scrypt.js": "^0.1.0", "uuid": "^2.0.1", "utf8": "^2.1.1"