use standardjs formatting

This commit is contained in:
Daniel Cousens 2015-02-23 10:36:57 +11:00
parent 09d8e440de
commit 399803affa
41 changed files with 1252 additions and 1177 deletions

View file

@ -1,3 +1,5 @@
/* global describe, it, before, after */
var assert = require('assert')
var networks = require('../src/networks')
var sinon = require('sinon')
@ -7,36 +9,36 @@ var Transaction = require('../src/transaction')
var fixtures = require('./fixtures/network')
describe('networks', function() {
describe('networks', function () {
var txToBuffer
before(function(){
txToBuffer = sinon.stub(Transaction.prototype, "toBuffer")
before(function () {
txToBuffer = sinon.stub(Transaction.prototype, 'toBuffer')
})
after(function(){
after(function () {
Transaction.prototype.toBuffer.restore()
})
describe('constants', function() {
fixtures.valid.constants.forEach(function(f) {
describe('constants', function () {
fixtures.valid.constants.forEach(function (f) {
var network = networks[f.network]
Object.keys(f.bip32).forEach(function(name) {
Object.keys(f.bip32).forEach(function (name) {
var extb58 = f.bip32[name]
it('resolves ' + extb58 + ' to ' + f.network, function() {
it('resolves ' + extb58 + ' to ' + f.network, function () {
assert.equal(HDNode.fromBase58(extb58, network).network, network)
})
})
})
})
describe('estimateFee', function() {
fixtures.valid.estimateFee.forEach(function(f) {
describe('(' + f.network + ')', function() {
describe('estimateFee', function () {
fixtures.valid.estimateFee.forEach(function (f) {
describe('(' + f.network + ')', function () {
var network = networks[f.network]
it('calculates the fee correctly for ' + f.description, function() {
it('calculates the fee correctly for ' + f.description, function () {
var buffer = new Buffer(f.txSize)
txToBuffer.returns(buffer)