From be29f504579df126c8c9a0f5bc3f34f258de4e0c Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 13 Jun 2014 09:33:58 +1000 Subject: [PATCH] Address: fix consistent casing --- src/address.js | 8 ++++---- test/fixtures/address.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/address.js b/src/address.js index c54b94e..3da5dbd 100644 --- a/src/address.js +++ b/src/address.js @@ -11,7 +11,7 @@ function findScriptTypeByVersion(queryVersion) { var version = network[versionName] if (version === queryVersion) { - return versionName + return versionName.toLowerCase() } } } @@ -62,14 +62,14 @@ Address.prototype.toBase58Check = function () { Address.prototype.toScriptPubKey = function() { var scriptType = findScriptTypeByVersion(this.version) - if (scriptType === 'pubKeyHash') { + if (scriptType === 'pubkeyhash') { return templates.createPubKeyHashScriptPubKey(this.hash) - } else if (scriptType === 'scriptHash') { + } else if (scriptType === 'scripthash') { return templates.createP2SHScriptPubKey(this.hash) } - assert(false, this.toString() + ' has no matching script') + assert(false, this.toString() + ' has no matching Script') } Address.prototype.toString = Address.prototype.toBase58Check diff --git a/test/fixtures/address.json b/test/fixtures/address.json index 06557af..83b6a3a 100644 --- a/test/fixtures/address.json +++ b/test/fixtures/address.json @@ -62,7 +62,7 @@ ], "toScriptPubKey": [ { - "description": "24kPZCmVgzfkpGdXExy56234MRHrsqQxNWE has no matching script", + "description": "24kPZCmVgzfkpGdXExy56234MRHrsqQxNWE has no matching Script", "hex": "751e76e8199196d454941c45d1b3a323f1433bd6", "version": 153 }