From ff7b980143fb901f0d2228196111e94b6c81e6b1 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 21 Jun 2016 17:13:02 -0700 Subject: Fix eth sign with dennis' test input --- app/scripts/lib/id-management.js | 14 ++++++++------ test/unit/id-management-test.js | 24 +++++++++++++----------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/scripts/lib/id-management.js b/app/scripts/lib/id-management.js index 30ea866f4..cc50bd649 100644 --- a/app/scripts/lib/id-management.js +++ b/app/scripts/lib/id-management.js @@ -69,10 +69,12 @@ function padWithZeroes (number, length) { } function concatSig (v, r, s) { - r = padWithZeroes(ethUtil.fromSigned(r), 64) - s = padWithZeroes(ethUtil.fromSigned(s), 64) - r = ethUtil.stripHexPrefix(r.toString('hex')) - s = ethUtil.stripHexPrefix(s.toString('hex')) - v = ethUtil.stripHexPrefix(ethUtil.intToHex(v)) - return ethUtil.addHexPrefix(r.concat(s, v)) + const rSig = ethUtil.fromSigned(r) + const sSig = ethUtil.fromSigned(s) + const vSig = ethUtil.bufferToInt(v) + const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64) + const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64) + const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig)) + return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex') } + diff --git a/test/unit/id-management-test.js b/test/unit/id-management-test.js index 61cdf4d8b..cbc6403bc 100644 --- a/test/unit/id-management-test.js +++ b/test/unit/id-management-test.js @@ -16,18 +16,20 @@ describe('IdManagement', function() { }) describe('#signMsg', function () { - const address = '0x926cD0393816429a580037475ec23eD65fDC893B' - const message = '0x96b8d442f4c09a08d266bf37b18219465cfb341c1b3ab9792a6103a93583fdf7' - const privateKey = '0xd291f7aa01b94941b446f260bca42c0752762571428ad4ed6239613c66365cf4' - const expectedResult = '0x04881196121781472543750166203264808665659193717384627772472141185319786561270240926993050673320157359365329096037150419976876479876332927284781689204045461c' + it('passes the dennis test', function() { + const address = '0x9858e7d8b79fc3e6d989636721584498926da38a' + const message = '0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0' + const privateKey = '0x7dd98753d7b4394095de7d176c58128e2ed6ee600abe97c9f6d9fd65015d9b18' + const expectedResult = '0x28fcb6768e5110144a55b2e6ce9d1ea5a58103033632d272d2b5cf506906f7941a00b539383fd872109633d8c71c404e13dba87bc84166ee31b0e36061a69e161c' - const idManagement = new IdManagement() - const exportKeyStub = sinon.stub(idManagement, 'exportPrivateKey', (addr) => { - assert.equal(addr, address) - return privateKey - }) + const idManagement = new IdManagement() + const exportKeyStub = sinon.stub(idManagement, 'exportPrivateKey', (addr) => { + assert.equal(addr, address) + return privateKey + }) - const result = idManagement.signMsg(address, message) - assert.equal(result, expectedResult) + const result = idManagement.signMsg(address, message) + assert.equal(result, expectedResult) + }) }) }) -- cgit From 856a7c84cd3b2a523b229088f3f657650c0a2b0f Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 21 Jun 2016 17:21:55 -0700 Subject: Bump changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a890737c6..962d139f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Change out export icon for key. - Unify copy to clipboard icon +- Fixed eth.sign behavior. ## 2.4.0 2016-06-20 @@ -11,7 +12,6 @@ - Remove nonfunctional QR code button. - Make network loading indicator clickable to select accessible network. - Show more characters of addresses when space permits. -- Fixed eth.sign behavior. - Fixed bug when signing messages under 64 hex characters long. - Add disclaimer view with placeholder text for first time users. -- cgit From 73869ea233e64ee36825ab8ef4ad66a034c0a00b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 22 Jun 2016 11:06:06 -0700 Subject: Version 2.4.2 --- CHANGELOG.md | 3 +++ app/manifest.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 962d139f3..95eadd4b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,12 @@ ## Current Master +## 2.4.2 2016-06-22 + - Change out export icon for key. - Unify copy to clipboard icon - Fixed eth.sign behavior. +- Fix behavior of batched outbound transactions. ## 2.4.0 2016-06-20 diff --git a/app/manifest.json b/app/manifest.json index dede7402a..a0c3a7e8f 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "Metamask", - "version": "2.4.1", + "version": "2.4.2", "manifest_version": 2, "description": "__MSG_appDescription__", "icons": { -- cgit From a4ebb7656af0c11bf706689f4447ec0785d39c48 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 22 Jun 2016 11:07:42 -0700 Subject: Enhance nvmrc --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index e0ea36fee..9773998bc 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -6.0 +v6.0.0 -- cgit