Skip to content

Commit 4e04a7e

Browse files
committed
Transaction: use isFinite over Number.isFinite
1 parent 6c5a682 commit 4e04a7e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/transaction.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Transaction.prototype.addInput = function(tx, index, sequence) {
4949

5050
assert(Buffer.isBuffer(hash), 'Expected Transaction, txId or txHash, got ' + tx)
5151
assert.equal(hash.length, 32, 'Expected hash length of 32, got ' + hash.length)
52-
assert(Number.isFinite(index), 'Expected number index, got ' + index)
53-
assert(Number.isFinite(sequence), 'Expected number sequence, got ' + sequence)
52+
assert(isFinite(index), 'Expected number index, got ' + index)
53+
assert(isFinite(sequence), 'Expected number sequence, got ' + sequence)
5454

5555
// Add the input and return the input's index
5656
return (this.ins.push({
@@ -82,7 +82,7 @@ Transaction.prototype.addOutput = function(scriptPubKey, value) {
8282
}
8383

8484
assert(scriptPubKey instanceof Script, 'Expected Address or Script, got ' + scriptPubKey)
85-
assert(Number.isFinite(value), 'Expected number value, got ' + value)
85+
assert(isFinite(value), 'Expected number value, got ' + value)
8686

8787
// Add the output and return the output's index
8888
return (this.outs.push({

src/wallet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Wallet.prototype.setUnspentOutputs = function(unspents) {
303303
assert.equal(typeof txId, 'string', 'Expected txId, got ' + txId)
304304
assert.equal(txId.length, 64, 'Expected valid txId, got ' + txId)
305305
assert.doesNotThrow(function() { Address.fromBase58Check(unspent.address) }, 'Expected Base58 Address, got ' + unspent.address)
306-
assert(Number.isFinite(index), 'Expected number index, got ' + index)
306+
assert(isFinite(index), 'Expected number index, got ' + index)
307307
assert.equal(typeof unspent.value, 'number', 'Expected number value, got ' + unspent.value)
308308

309309
// FIXME: remove branch in 2.0.0

0 commit comments

Comments
 (0)