package: bump bs58check, drop node 0.12

This commit is contained in:
Daniel Cousens 2016-12-21 12:52:09 +11:00 committed by Daniel Cousens
parent 4aadbf5e4f
commit 14f9218389
8 changed files with 14 additions and 18 deletions

View file

@ -1,15 +1,15 @@
sudo: false
language: node_js
node_js:
- "0.12"
- "4"
- "5"
- "6"
- "7"
matrix:
include:
- node_js: "6"
- node_js: "7"
env: TEST_SUITE=standard
- node_js: "6"
- node_js: "7"
env: TEST_SUITE=coverage
env:
- TEST_SUITE=integration

View file

@ -54,8 +54,7 @@
"bigi": "^1.4.0",
"bip66": "^1.1.0",
"bitcoin-ops": "^1.3.0",
"bs58check": "^1.0.5",
"buffer-reverse": "^1.0.0",
"bs58check": "^2.0.0",
"create-hash": "^1.1.0",
"create-hmac": "^1.1.3",
"ecurve": "^1.0.0",
@ -68,7 +67,7 @@
},
"devDependencies": {
"async": "^2.0.1",
"bs58": "^3.0.0",
"bs58": "^4.0.0",
"cb-http-client": "^0.2.0",
"coinselect": "^3.1.1",
"minimaldata": "^1.0.2",

View file

@ -1,6 +1,5 @@
var bufferutils = require('./bufferutils')
var bcrypto = require('./crypto')
var bufferReverse = require('buffer-reverse')
var fastMerkleRoot = require('merkle-lib/fastRoot')
var typeforce = require('typeforce')
var types = require('./types')
@ -80,7 +79,7 @@ Block.prototype.getHash = function () {
}
Block.prototype.getId = function () {
return bufferReverse(this.getHash()).toString('hex')
return this.getHash().reverse().toString('hex')
}
Block.prototype.getUTCDate = function () {
@ -164,7 +163,7 @@ Block.prototype.checkMerkleRoot = function () {
}
Block.prototype.checkProofOfWork = function () {
var hash = bufferReverse(this.getHash())
var hash = this.getHash().reverse()
var target = Block.calculateTarget(this.bits)
return hash.compare(target) <= 0

View file

@ -1,7 +1,6 @@
var bcrypto = require('./crypto')
var bscript = require('./script')
var bufferutils = require('./bufferutils')
var bufferReverse = require('buffer-reverse')
var opcodes = require('bitcoin-ops')
var typeforce = require('typeforce')
var types = require('./types')
@ -395,7 +394,7 @@ Transaction.prototype.getHash = function () {
Transaction.prototype.getId = function () {
// transaction hash's are displayed in reverse order
return bufferReverse(this.getHash()).toString('hex')
return this.getHash().reverse().toString('hex')
}
Transaction.prototype.toBuffer = function (buffer, initialOffset) {

View file

@ -1,7 +1,6 @@
var baddress = require('./address')
var bcrypto = require('./crypto')
var bscript = require('./script')
var bufferReverse = require('buffer-reverse')
var networks = require('./networks')
var ops = require('bitcoin-ops')
var typeforce = require('typeforce')
@ -299,7 +298,7 @@ TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOu
// is it a hex string?
if (typeof txHash === 'string') {
// transaction hashs's are displayed in reverse order, un-reverse it
txHash = bufferReverse(new Buffer(txHash, 'hex'))
txHash = new Buffer(txHash, 'hex').reverse()
// is it a Transaction object?
} else if (txHash instanceof Transaction) {

View file

@ -22,7 +22,7 @@ describe('Bitcoin-core', function () {
it('can decode ' + fb58, function () {
var buffer = base58.decode(fb58)
var actual = new Buffer(buffer).toString('hex')
var actual = buffer.toString('hex')
assert.strictEqual(actual, fhex)
})
@ -150,7 +150,7 @@ describe('Bitcoin-core', function () {
var input = inputs[i]
// reverse because test data is reversed
var prevOutHash = [].reverse.call(new Buffer(input[0], 'hex'))
var prevOutHash = new Buffer(input[0], 'hex').reverse()
var prevOutIndex = input[1]
assert.deepEqual(txIn.hash, prevOutHash)
@ -193,7 +193,7 @@ describe('Bitcoin-core', function () {
var hash = transaction.hashForSignature(inIndex, script, hashType)
// reverse because test data is reversed
assert.equal([].reverse.call(hash).toString('hex'), expectedHash)
assert.equal(hash.reverse().toString('hex'), expectedHash)
})
})
})

View file

@ -45,7 +45,7 @@ describe('bitcoinjs-lib (crypto)', function () {
assert(bitcoin.script.pubKeyHash.input.check(scriptChunks), 'Expected pubKeyHash script')
var prevOutTxId = [].reverse.call(new Buffer(transaction.ins[input.vout].hash)).toString('hex')
var prevOutTxId = new Buffer(transaction.ins[input.vout].hash).reverse().toString('hex')
var prevVout = transaction.ins[input.vout].index
tasks.push(function (callback) {

View file

@ -95,7 +95,7 @@ describe('TransactionBuilder', function () {
var tx = new Transaction()
f.inputs.forEach(function (input) {
var txHash = [].reverse.call(new Buffer(input.txId, 'hex'))
var txHash = new Buffer(input.txId, 'hex').reverse()
tx.addInput(txHash, input.vout, undefined, bscript.fromASM(input.scriptSig))
})