Skip to content

Commit

Permalink
deps: massive refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Oct 3, 2016
1 parent f96ee52 commit f022314
Show file tree
Hide file tree
Showing 109 changed files with 2,307 additions and 1,895 deletions.
19 changes: 9 additions & 10 deletions bench/coin.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
'use strict';

var bn = require('bn.js');
var bcoin = require('../').set('main');
var constants = bcoin.constants;
var utils = bcoin.utils;
var constants = require('../lib/protocol/constants');
var utils = require('../lib/utils/utils');
var assert = require('assert');
var scriptTypes = constants.scriptTypes;
var bench = require('./bench');
var fs = require('fs');

bcoin.cache();
var Coins = require('../lib/chain/coins');
var TX = require('../lib/primitives/tx');

var wtx = fs.readFileSync(__dirname + '/../test/data/wtx.hex', 'utf8');
wtx = bcoin.tx.fromRaw(wtx.trim(), 'hex');
wtx = tx.fromRaw(wtx.trim(), 'hex');

var coins = bcoin.coins.fromTX(wtx);
var coins = Coins.fromTX(wtx);
var raw;

var end = bench('serialize');
Expand All @@ -24,16 +23,16 @@ end(i);

var end = bench('parse');
for (var i = 0; i < 10000; i++)
bcoin.coins.fromRaw(raw);
Coins.fromRaw(raw);
end(i);

var end = bench('parse-single');
var hash = wtx.hash('hex');
for (var i = 0; i < 10000; i++)
bcoin.coins.parseCoin(raw, hash, 5);
Coins.parseCoin(raw, hash, 5);
end(i);

var coins = bcoin.coins.fromRaw(raw);
var coins = Coins.fromRaw(raw);
var end = bench('get');
var j;

Expand Down
2 changes: 1 addition & 1 deletion bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var spawn = require('../lib/utils/spawn');
var Client = require('../lib/http/client');
var Wallet = require('../lib/http/wallet');
var co = spawn.co;
var assert = utils.assert;
var assert = require('assert');
var main;

function CLI() {
Expand Down
2 changes: 1 addition & 1 deletion bin/node
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ process.title = 'bcoin';

var bcoin = require('../');
var utils = bcoin.utils;
var assert = utils.assert;
var assert = require('assert');

var options = bcoin.config({
config: true,
Expand Down
2 changes: 1 addition & 1 deletion bin/spvnode
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ process.title = 'bcoin';

var bcoin = require('../');
var utils = bcoin.utils;
var assert = utils.assert;
var assert = require('assert');

var options = bcoin.config({
config: true,
Expand Down
Loading

0 comments on commit f022314

Please sign in to comment.