From c44af2109e2f23bf3cfdacdce61515e7f3fe239b Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sun, 20 Apr 2014 04:54:50 +1000 Subject: [PATCH] Uses typeof address === 'string' instead --- src/message.js | 4 ++-- src/transaction.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/message.js b/src/message.js index dc4a9d5..6b0738c 100644 --- a/src/message.js +++ b/src/message.js @@ -46,9 +46,9 @@ function sign(key, message) { return sig } +// FIXME: stricter API? function verify(address, sig, message) { - // FIXME: stricter API? - if (!(address instanceof Address)) { + if (typeof address === 'string') { address = Address.fromBase58Check(address) } diff --git a/src/transaction.js b/src/transaction.js index 98b74fe..203762b 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -87,6 +87,7 @@ Transaction.prototype.addInput = function (tx, outIndex) { * iii) An address:value string * iv) Either ii), iii) with an optional network argument * + * FIXME: This is a bit convoluted */ Transaction.prototype.addOutput = function (address, value, network) { if (arguments[0] instanceof TransactionOut) { @@ -104,8 +105,7 @@ Transaction.prototype.addOutput = function (address, value, network) { network = network || Network.bitcoin - // FIXME: Stricter Transaction API - if (!(address instanceof Address)) { + if (typeof address === 'string') { address = Address.fromBase58Check(address) }