fix conflics
This commit is contained in:
commit
340153c629
|
@ -31,3 +31,5 @@ public/lib/*
|
|||
db/txs/*
|
||||
db/blocks/*
|
||||
|
||||
public/js/*
|
||||
public/css/*
|
||||
|
|
64
Gruntfile.js
64
Gruntfile.js
|
@ -2,10 +2,12 @@
|
|||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
|
||||
//Load NPM tasks
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-css');
|
||||
grunt.loadNpmTasks('grunt-mocha-test');
|
||||
grunt.loadNpmTasks('grunt-nodemon');
|
||||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
|
@ -48,19 +50,70 @@ module.exports = function(grunt) {
|
|||
},
|
||||
jshint: {
|
||||
all: {
|
||||
src: ['Gruntfile.js', 'insight.js', 'app/**/*.js', 'public/js/**','lib/*.js'],
|
||||
src: ['Gruntfile.js', 'insight.js', 'app/**/*.js', 'public/src/js/**/*.js','lib/*.js'],
|
||||
options: {
|
||||
jshintrc: true
|
||||
}
|
||||
}
|
||||
},
|
||||
concat: {
|
||||
options: {
|
||||
process: function(src, filepath) {
|
||||
if (filepath.substr(filepath.length - 2) === 'js') {
|
||||
return '// Source: ' + filepath + '\n' +
|
||||
src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
|
||||
} else {
|
||||
return src;
|
||||
}
|
||||
}
|
||||
},
|
||||
vendors: {
|
||||
src: ['public/lib/momentjs/min/moment.min.js', 'public/lib/qrcode-generator/js/qrcode.js', 'public/lib/zeroclipboard/ZeroClipboard.min.js'],
|
||||
dest: 'public/js/vendors.js'
|
||||
},
|
||||
angular: {
|
||||
src: ['public/lib/angular/angular.min.js', 'public/lib/angular-resource/angular-resource.min.js', 'public/lib/angular-route/angular-route.min.js', 'public/lib/angular-qrcode/qrcode.js', 'public/lib/angular-animate/angular-animate.min.js', 'public/lib/angular-bootstrap/ui-bootstrap.min.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.min.js', 'public/lib/angular-ui-utils/ui-utils.min.js', 'public/lib/ngprogress/build/ngProgress.min.js'],
|
||||
dest: 'public/js/angularjs-all.js'
|
||||
},
|
||||
main: {
|
||||
src: ['public/src/js/app.js', 'public/src/js/controllers/*.js', 'public/src/js/services/*.js', 'public/src/js/directives.js', 'public/src/js/filters.js', 'public/src/js/config.js', 'public/src/js/init.js'],
|
||||
dest: 'public/js/main.js'
|
||||
},
|
||||
css: {
|
||||
src: ['public/lib/ngprogress/ngProgress.css', 'public/src/css/**/*.css'],
|
||||
dest: 'public/css/main.css'
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n',
|
||||
mangle: false
|
||||
},
|
||||
vendors: {
|
||||
src: 'public/js/vendors.js',
|
||||
dest: 'public/js/vendors.min.js'
|
||||
},
|
||||
angular: {
|
||||
src: 'public/js/angularjs-all.js',
|
||||
dest: 'public/js/angularjs-all.min.js'
|
||||
},
|
||||
main: {
|
||||
src: 'public/js/main.js',
|
||||
dest: 'public/js/main.min.js'
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
css: {
|
||||
src: 'public/css/main.css',
|
||||
dest: 'public/css/main.min.css'
|
||||
}
|
||||
},
|
||||
mochaTest: {
|
||||
options: {
|
||||
reporter: 'spec',
|
||||
},
|
||||
src: ['test/**/*.js'],
|
||||
},
|
||||
|
||||
nodemon: {
|
||||
dev: {
|
||||
script: 'insight.js',
|
||||
|
@ -93,7 +146,10 @@ module.exports = function(grunt) {
|
|||
grunt.option('force', true);
|
||||
|
||||
//Default task(s).
|
||||
grunt.registerTask('default', ['jshint','concurrent']);
|
||||
grunt.registerTask('default', ['jshint', 'concurrent']);
|
||||
|
||||
//Compile task (concat + minify)
|
||||
grunt.registerTask('compile', ['concat', 'uglify', 'cssmin']);
|
||||
|
||||
//Test task.
|
||||
grunt.registerTask('test', ['env:test', 'mochaTest']);
|
||||
|
|
|
@ -72,7 +72,6 @@ console.log('[blocks.js.60]: could not get %s from RPC. Orphan? Error?', blockha
|
|||
* List of blocks by date
|
||||
*/
|
||||
exports.list = function(req, res) {
|
||||
var limit = req.query.limit || -1;
|
||||
var isToday = false;
|
||||
|
||||
//helper to convert timestamps to yyyy-mm-dd format
|
||||
|
@ -103,14 +102,18 @@ exports.list = function(req, res) {
|
|||
var prev = formatTimestamp(new Date((gte - 86400) * 1000));
|
||||
var next = formatTimestamp(new Date(lte * 1000));
|
||||
|
||||
bdb.getBlocksByDate(gte, lte, limit, function(err, blocks) {
|
||||
bdb.getBlocksByDate(gte, lte, function(err, blocks) {
|
||||
if (err) {
|
||||
res.status(500).send(err);
|
||||
}
|
||||
else {
|
||||
var blockshashList = [];
|
||||
for(var i=0;i<blocks.length;i++) {
|
||||
blockshashList.unshift(blocks[i].hash);
|
||||
var limit = parseInt(req.query.limit || blocks.length);
|
||||
if (blocks.length < limit) {
|
||||
limit = blocks.length;
|
||||
}
|
||||
for(var i=0;i<limit;i++) {
|
||||
blockshashList.push(blocks[i].hash);
|
||||
}
|
||||
async.mapSeries(blockshashList, getBlock, function(err, allblocks) {
|
||||
res.jsonp({
|
||||
|
|
|
@ -1,46 +1,6 @@
|
|||
#footer(data-ng-include="'/views/includes/footer.html'", role='navigation')
|
||||
|
||||
script(type='text/javascript', src='/socket.io/socket.io.js')
|
||||
script(type='text/javascript', src='/lib/momentjs/min/moment.min.js')
|
||||
script(type='text/javascript', src='/lib/qrcode-generator/js/qrcode.js')
|
||||
script(type='text/javascript', src='/lib/zeroclipboard/ZeroClipboard.min.js')
|
||||
|
||||
//AngularJS
|
||||
script(type='text/javascript', src='/lib/angular/angular.min.js')
|
||||
script(type='text/javascript', src='/lib/angular-resource/angular-resource.min.js')
|
||||
script(type='text/javascript', src='/lib/angular-route/angular-route.min.js')
|
||||
script(type='text/javascript', src='/lib/angular-qrcode/qrcode.js')
|
||||
script(type='text/javascript', src='/lib/angular-animate/angular-animate.min.js')
|
||||
|
||||
//Angular UI
|
||||
script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap.min.js')
|
||||
script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap-tpls.min.js')
|
||||
script(type='text/javascript', src='/lib/angular-ui-utils/ui-utils.min.js')
|
||||
|
||||
//Application Init
|
||||
script(type='text/javascript', src='/js/app.js')
|
||||
script(type='text/javascript', src='/js/config.js')
|
||||
script(type='text/javascript', src='/js/directives.js')
|
||||
script(type='text/javascript', src='/js/filters.js')
|
||||
|
||||
//Application Services
|
||||
script(type='text/javascript', src='/js/services/global.js')
|
||||
script(type='text/javascript', src='/js/services/status.js')
|
||||
script(type='text/javascript', src='/js/services/address.js')
|
||||
script(type='text/javascript', src='/js/services/transactions.js')
|
||||
script(type='text/javascript', src='/js/services/blocks.js')
|
||||
script(type='text/javascript', src='/js/services/socket.js')
|
||||
script(type='text/javascript', src='/js/services/currency.js')
|
||||
|
||||
//Application Controllers
|
||||
script(type='text/javascript', src='/js/controllers/index.js')
|
||||
script(type='text/javascript', src='/js/controllers/header.js')
|
||||
script(type='text/javascript', src='/js/controllers/search.js')
|
||||
script(type='text/javascript', src='/js/controllers/blocks.js')
|
||||
script(type='text/javascript', src='/js/controllers/transactions.js')
|
||||
script(type='text/javascript', src='/js/controllers/address.js')
|
||||
script(type='text/javascript', src='/js/controllers/status.js')
|
||||
script(type='text/javascript', src='/js/controllers/footer.js')
|
||||
script(type='text/javascript', src='/js/controllers/connection.js')
|
||||
script(type='text/javascript', src='/js/controllers/currency.js')
|
||||
script(type='text/javascript', src='/js/init.js')
|
||||
script(type='text/javascript', src='/js/vendors.min.js')
|
||||
script(type='text/javascript', src='/js/angularjs-all.min.js')
|
||||
script(type='text/javascript', src='/js/main.min.js')
|
||||
|
|
|
@ -13,4 +13,4 @@ head
|
|||
|
||||
link(rel='stylesheet', href='//fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,400italic')
|
||||
link(rel='stylesheet', href='/lib/bootstrap/dist/css/bootstrap.min.css')
|
||||
link(rel='stylesheet', href='/css/common.css')
|
||||
link(rel='stylesheet', href='/css/main.min.css')
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
"dependencies": {
|
||||
"angular": "latest",
|
||||
"angular-resource": "latest",
|
||||
"angular-cookies": "latest",
|
||||
"angular-mocks": "latest",
|
||||
"angular-route": "latest",
|
||||
"bootstrap": "3.0.3",
|
||||
|
@ -13,6 +12,7 @@
|
|||
"angular-qrcode": "latest",
|
||||
"angular-animate": "latest",
|
||||
"momentjs": "~2.5.0",
|
||||
"zeroclipboard": "~1.3.0-beta.1"
|
||||
"zeroclipboard": "~1.3.0-beta.1",
|
||||
"ngprogress": "~1.0.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,13 +162,12 @@ function spec(b) {
|
|||
});
|
||||
};
|
||||
|
||||
BlockDb.prototype.getBlocksByDate = function(start_ts, end_ts, limit, cb) {
|
||||
BlockDb.prototype.getBlocksByDate = function(start_ts, end_ts, cb) {
|
||||
var list = [];
|
||||
db.createReadStream({
|
||||
start: TIMESTAMP_PREFIX + start_ts,
|
||||
end: TIMESTAMP_PREFIX + end_ts,
|
||||
fillCache: true,
|
||||
limit: parseInt(limit) // force to int
|
||||
fillCache: true
|
||||
})
|
||||
.on('data', function (data) {
|
||||
list.push({
|
||||
|
@ -180,7 +179,7 @@ function spec(b) {
|
|||
return cb(err);
|
||||
})
|
||||
.on('end', function () {
|
||||
return cb(null, list);
|
||||
return cb(null, list.reverse());
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -84,9 +84,12 @@
|
|||
"devDependencies": {
|
||||
"grunt-contrib-watch": "latest",
|
||||
"grunt-contrib-jshint": "latest",
|
||||
"grunt-contrib-concat": "~0.3.0",
|
||||
"grunt-contrib-uglify": "~0.3.2",
|
||||
"grunt-nodemon": "latest",
|
||||
"grunt-concurrent": "latest",
|
||||
"grunt-mocha-test": "latest",
|
||||
"should": "latest"
|
||||
"should": "latest",
|
||||
"grunt-css": "~0.5.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,13 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
|||
font-family: 'Ubuntu', sans-serif;
|
||||
}
|
||||
|
||||
#ngProgress {
|
||||
box-shadow: none !important;
|
||||
height: 4px !important;
|
||||
color: #373D42 !important;
|
||||
background: #373D42 !important;
|
||||
}
|
||||
|
||||
/* Wrapper for page content to push down footer */
|
||||
#wrap {
|
||||
min-height: 100%;
|
||||
|
@ -146,6 +153,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
|||
background-color: #F4F4F4;
|
||||
border-radius: 5px;
|
||||
padding: 14px;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.col-gray-responsive {
|
||||
|
@ -155,6 +163,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
|||
.col-gray-fixed {
|
||||
position: fixed;
|
||||
width: 250px;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
@ -234,7 +243,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
|||
margin: 20px 0 10px;
|
||||
overflow: hidden;
|
||||
padding: 15px;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.btn {
|
||||
|
@ -341,8 +350,6 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
|||
|
||||
#wrap > .container { padding: 60px 15px 0; }
|
||||
|
||||
.container .text-muted a { color: #eee; }
|
||||
|
||||
#footer > .container { padding: auto 15px; }
|
||||
|
||||
.code { font-size: 80%; }
|
|
@ -4,6 +4,7 @@ angular.module('insight',[
|
|||
'ngAnimate',
|
||||
'ngResource',
|
||||
'ngRoute',
|
||||
'ngProgress',
|
||||
'ui.bootstrap',
|
||||
'ui.route',
|
||||
'monospaced.qrcode',
|
|
@ -47,8 +47,14 @@ angular.module('insight')
|
|||
$locationProvider.html5Mode(true);
|
||||
$locationProvider.hashPrefix('!');
|
||||
})
|
||||
.run(function($rootScope, $route) {
|
||||
.run(function($rootScope, $route, ngProgress) {
|
||||
$rootScope.$on('$routeChangeStart', function() {
|
||||
ngProgress.start();
|
||||
});
|
||||
|
||||
$rootScope.$on('$routeChangeSuccess', function() {
|
||||
ngProgress.complete();
|
||||
|
||||
//Change page title, based on Route information
|
||||
$rootScope.titleDetail = '';
|
||||
$rootScope.title = $route.current.title;
|
0
public/js/controllers/header.js → public/src/js/controllers/header.js
Executable file → Normal file
0
public/js/controllers/header.js → public/src/js/controllers/header.js
Executable file → Normal file
41
public/js/controllers/index.js → public/src/js/controllers/index.js
Executable file → Normal file
41
public/js/controllers/index.js → public/src/js/controllers/index.js
Executable file → Normal file
|
@ -4,9 +4,18 @@ var TRANSACTION_DISPLAYED = 5;
|
|||
var BLOCKS_DISPLAYED = 5;
|
||||
|
||||
angular.module('insight.system').controller('IndexController',
|
||||
function($scope, $rootScope, Global, getSocket, Blocks, Block, Transactions, Transaction) {
|
||||
function($scope, $rootScope, Global, getSocket, Blocks, Transaction) {
|
||||
$scope.global = Global;
|
||||
|
||||
var _getBlocks = function() {
|
||||
Blocks.get({
|
||||
limit: BLOCKS_DISPLAYED
|
||||
}, function(res) {
|
||||
$scope.blocks = res.blocks;
|
||||
$scope.blocksLength = res.lenght;
|
||||
});
|
||||
};
|
||||
|
||||
var _getTransaction = function(txid, cb) {
|
||||
Transaction.get({
|
||||
txId: txid
|
||||
|
@ -15,14 +24,6 @@ angular.module('insight.system').controller('IndexController',
|
|||
});
|
||||
};
|
||||
|
||||
var _getBlock = function(hash) {
|
||||
Block.get({
|
||||
blockHash: hash
|
||||
}, function(res) {
|
||||
$scope.blocks.unshift(res);
|
||||
});
|
||||
};
|
||||
|
||||
var socket = getSocket($scope);
|
||||
socket.emit('subscribe', 'inv');
|
||||
|
||||
|
@ -42,14 +43,9 @@ angular.module('insight.system').controller('IndexController',
|
|||
});
|
||||
|
||||
socket.on('block', function(block) {
|
||||
console.log('Block received! ' + JSON.stringify(block));
|
||||
|
||||
var blockHash = block.toString();
|
||||
if (parseInt($scope.blocks.length, 10) > parseInt(BLOCKS_DISPLAYED, 10) - 1) {
|
||||
$scope.blocks.pop();
|
||||
}
|
||||
|
||||
_getBlock(blockHash);
|
||||
console.log('Block received! ' + JSON.stringify(blockHash));
|
||||
_getBlocks();
|
||||
});
|
||||
|
||||
$scope.humanSince = function(time) {
|
||||
|
@ -58,18 +54,7 @@ angular.module('insight.system').controller('IndexController',
|
|||
};
|
||||
|
||||
$scope.index = function() {
|
||||
Blocks.get({
|
||||
limit: BLOCKS_DISPLAYED
|
||||
}, function(res) {
|
||||
$scope.blocks = res.blocks;
|
||||
$scope.blocksLength = res.lenght;
|
||||
});
|
||||
|
||||
Transactions.get({
|
||||
limit: TRANSACTION_DISPLAYED
|
||||
}, function(res) {
|
||||
$scope.txs = res.txs;
|
||||
});
|
||||
_getBlocks();
|
||||
};
|
||||
|
||||
$scope.txs = [];
|
|
@ -33,19 +33,17 @@
|
|||
<th>Timestamp</th>
|
||||
<th>Transactions</th>
|
||||
<th>Size</th>
|
||||
<th>Confirmations</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr data-ng-show="loading">
|
||||
<td colspan="5">Waiting for blocks...</td>
|
||||
<td colspan="4">Waiting for blocks...</td>
|
||||
</tr>
|
||||
<tr class="fader" data-ng-repeat='b in blocks'>
|
||||
<td><a href="/block/{{b.hash}}">{{b.height}}</a></td>
|
||||
<td>{{b.time * 1000 | date:'medium'}}</td>
|
||||
<td>{{b.tx.length}}</td>
|
||||
<td>{{b.size}}</td>
|
||||
<td>{{b.confirmations}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -14,11 +14,10 @@
|
|||
<th>Age</th>
|
||||
<th><span class="ellipsis">Transactions</span></th>
|
||||
<th>Size</th>
|
||||
<th><span class="ellipsis">Confirmations</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr data-ng-show="!blocks.length"><td colspan="5">Waiting for blocks...</td></tr>
|
||||
<tr data-ng-show="!blocks.length"><td colspan="4">Waiting for blocks...</td></tr>
|
||||
<tr class="fader" data-ng-repeat='b in blocks'>
|
||||
<td>
|
||||
<a href="/block/{{b.hash}}">{{b.height}}</a>
|
||||
|
@ -26,14 +25,11 @@
|
|||
<td><span class="ellipsis">{{humanSince(b.time)}}</span></td>
|
||||
<td>{{b.tx.length}}</td>
|
||||
<td>{{b.size}}</td>
|
||||
<td>{{b.confirmations}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2> About </h2>
|
||||
<p class="text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas, sint, neque harum libero eos maiores rerum rem fuga quae architecto ea incidunt dolore optio ullam sit placeat vero perferendis beatae?</p>
|
||||
<p class="text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis, unde quidem commodi dolor asperiores ullam molestias sit a sapiente ipsa!</p>
|
||||
<p class="text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt tempora fugiat dolorem cupiditate perspiciatis praesentium.</p>
|
||||
<p class="text-muted">Insight is a bitcoin blockchain API for writing web wallets and other apps that need more advanced blockchain queries than provided by bitcoind RPC. Check out the <a href="http://github.com/bitpay/insight" target="_blank">source code</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-gray">
|
||||
|
@ -48,43 +44,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr data-ng-show="!txs.length"><td colspan="5">Waiting for transactions...</td></tr>
|
||||
<tr data-ng-show="!txs.length"><td colspan="3">Waiting for transactions...</td></tr>
|
||||
<tr class="fader" data-ng-repeat='tx in txs'>
|
||||
<td>
|
||||
<a class="ellipsis" href="/tx/{{tx.txid}}">{{tx.txid}}</a>
|
||||
</td>
|
||||
<td><span class="ellipsis">{{humanSince(tx.time)}}</span></td>
|
||||
<td>{{tx.valueOut}}</td>
|
||||
<td><span class="ellipsis">{{tx.valueOut}}</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3> Other Bitcoin Links </h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="">Most Popular Addresses</a>
|
||||
<small> - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores.</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Addresses</a>
|
||||
<small> - Addresses which have received the most payments</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Lorem ipsum dolor.</a>
|
||||
<small> - Lorem ipsum dolor sit amet.</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Most Popular Addresses</a>
|
||||
<small> - Addresses which have received the most payments</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Lorem ipsum dolor sit.</a>
|
||||
<small> - Lorem ipsum dolor sit amet, consectetur adipisicing.</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Addresses</a>
|
||||
<small> - Addresses which have received the most payments</small>
|
||||
</li>
|
||||
</ul>
|
||||
</div> <!-- END OF COL-3 -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
|
||||
var TESTING_BLOCK0 = '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943';
|
||||
var TESTING_BLOCK1 = '00000000b873e79784647a6c82962c70d228557d24a747ea4d1b8bbe878e1206';
|
||||
var TESTING_BLOCK0 = '00000000b873e79784647a6c82962c70d228557d24a747ea4d1b8bbe878e1206';
|
||||
var TESTING_BLOCK1 = '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943';
|
||||
var START_TS = 1;
|
||||
var END_TS = '1296688928~'; // 2/2/2011 23:23PM
|
||||
var LIMIT = 2;
|
||||
|
||||
var assert = require('assert'),
|
||||
BlockDb = require('../../lib/BlockDb').class();
|
||||
|
@ -24,7 +23,7 @@ describe('BlockDb getBlocksByDate', function(){
|
|||
|
||||
it('Get Hash by Date', function(done) {
|
||||
|
||||
bDb.getBlocksByDate(START_TS, END_TS, LIMIT, function(err, list) {
|
||||
bDb.getBlocksByDate(START_TS, END_TS, function(err, list) {
|
||||
if (err) done(err);
|
||||
assert(list, 'returns list');
|
||||
assert.equal(list.length,2, 'list has 2 items');
|
||||
|
|
Loading…
Reference in New Issue