Skip to content
Snippets Groups Projects
Commit 974a44a6 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #847 Add parameters to /blockchain/parameters

parent 6e5fe8f3
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,10 @@ function ConfDAL(rootPath, qioFS, parentCore, localDAL, AbstractStorage) { ...@@ -40,7 +40,10 @@ function ConfDAL(rootPath, qioFS, parentCore, localDAL, AbstractStorage) {
"medianTimeBlocks": parseInt(conf.medianTimeBlocks,10), "medianTimeBlocks": parseInt(conf.medianTimeBlocks,10),
"avgGenTime": parseInt(conf.avgGenTime,10), "avgGenTime": parseInt(conf.avgGenTime,10),
"dtDiffEval": parseInt(conf.dtDiffEval,10), "dtDiffEval": parseInt(conf.dtDiffEval,10),
"percentRot": parseFloat(conf.percentRot) "percentRot": parseFloat(conf.percentRot),
"udTime0": parseInt(conf.udTime0),
"udReevalTime0": parseInt(conf.udReevalTime0),
"dtReeval": parseInt(conf.dtReeval)
}; };
}); });
......
...@@ -21,6 +21,10 @@ const server = duniter( ...@@ -21,6 +21,10 @@ const server = duniter(
currency: 'bb', currency: 'bb',
httpLogs: true, httpLogs: true,
sigQty: 1, sigQty: 1,
dt: 60,
dtReeval: 120,
udTime0: 1488902199,
udReevalTime0: 1520438199,
pair: { pair: {
pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd',
sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP' sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'
...@@ -61,6 +65,15 @@ describe("HTTP API", function() { ...@@ -61,6 +65,15 @@ describe("HTTP API", function() {
describe("/blockchain", function() { describe("/blockchain", function() {
it('/parameters/ should give the parameters', function() {
return expectJSON(rp('http://127.0.0.1:7777/blockchain/parameters', { json: true }), {
udTime0: 1488902199,
udReevalTime0: 1520438199,
dt: 60,
dtReeval: 120
});
});
it('/block/0 should exist', function() { it('/block/0 should exist', function() {
return expectJSON(rp('http://127.0.0.1:7777/blockchain/block/0', { json: true }), { return expectJSON(rp('http://127.0.0.1:7777/blockchain/block/0', { json: true }), {
number: 0 number: 0
...@@ -154,7 +167,7 @@ describe("HTTP API", function() { ...@@ -154,7 +167,7 @@ describe("HTTP API", function() {
client.on('message', function message(data) { client.on('message', function message(data) {
const block = JSON.parse(data); const block = JSON.parse(data);
should(block).have.property('number', 4); should(block).have.property('number', 4);
should(block).have.property('dividend', null); should(block).have.property('dividend');
if (!completed) { if (!completed) {
completed = true; completed = true;
done(); done();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment