Unverified Commit 49794f42 authored by Cédric Moreau's avatar Cédric Moreau Committed by GitHub
Browse files

Merge branch 'dev' into typage

parents 1408b5d0 a7a7e5fa
......@@ -48,6 +48,8 @@ test/integration/membership_chainability.js*
test/integration/membership_chainability.d.ts
test/integration/tools/toolbox.js*
test/integration/tools/toolbox.d.ts
test/integration/tools/TestUser.js*
test/integration/tools/TestUser.d.ts
test/integration/documents-currency.js*
test/integration/documents-currency.d.ts
test/fast/modules/crawler/block_pulling.js*
......
......@@ -42,6 +42,7 @@ export const ExecuteCommand = () => {
.option('--remep <endpoint>', 'With `config` command, remove given endpoint to the list of endpoints of this node')
.option('--cpu <percent>', 'Percent of CPU usage for proof-of-work computation', parsePercent)
.option('--nb-cores <number>', 'Number of cores uses for proof-of-work computation', parseInt)
.option('--prefix <nodeId>', 'Prefix node id for the first character of nonce', parseInt)
.option('-c, --currency <name>', 'Name of the currency managed by this node.')
......
......@@ -28,5 +28,9 @@ export const Buid = {
},
buid: buidFunctions
},
getBlockstamp: (block:{ number:number, hash:string }) => {
return [block.number, block.hash].join('-')
}
};
import {RevocationDTO} from "./RevocationDTO"
import {hashf} from "../common"
import {DBIdentity, NewDBIdentity} from "../dal/sqliteDAL/IdentityDAL"
const DEFAULT_DOCUMENT_VERSION = 10
export interface HashableIdentity {
......@@ -50,6 +51,10 @@ export class IdentityDTO {
return raw
}
getRawUnSigned() {
return this.rawWithoutSig()
}
getRawSigned() {
return this.rawWithoutSig() + this.sig + "\n"
}
......
import {Cloneable} from "./Cloneable";
import {hashf} from "../common";
const DEFAULT_DOCUMENT_VERSION = 10
export interface ShortRevocation {
......@@ -39,6 +40,10 @@ export class RevocationDTO implements ShortRevocation, Cloneable {
return this.rawWithoutSig() + this.revocation + "\n"
}
getRawUnsigned() {
return this.rawWithoutSig()
}
// TODO: to remove when BMA has been merged in duniter/duniter repo
json() {
return {
......
......@@ -21,6 +21,11 @@ export const ProverDependency = {
if (conf.cpu === null || conf.cpu === undefined) {
conf.cpu = ProverConstants.DEFAULT_CPU;
}
if (conf.nbCores === null || conf.nbCores === undefined) {
conf.nbCores = Math.min(Constants.CORES_MAXIMUM_USE_IN_PARALLEL, require('os').cpus().length)
} else if (conf.nbCores <= 0) {
conf.nbCores = 1
}
if (conf.prefix === null || conf.prefix === undefined) {
conf.prefix = ProverConstants.DEFAULT_PEER_ID;
}
......
......@@ -20,7 +20,7 @@ export class PowEngine {
constructor(private conf:ConfDTO, logger:any) {
// We use as much cores as available, but not more than CORES_MAXIMUM_USE_IN_PARALLEL
this.nbWorkers = (conf && conf.nbCores) || Math.min(ProverConstants.CORES_MAXIMUM_USE_IN_PARALLEL, require('os').cpus().length)
this.nbWorkers = conf.nbCores
this.cluster = new PowCluster(this.nbWorkers, logger)
this.id = this.cluster.clusterId
}
......@@ -35,8 +35,10 @@ export class PowEngine {
await this.cluster.cancelWork()
}
if (os.arch().match(/arm/)) {
stuff.newPoW.conf.cpu /= 2; // Don't know exactly why is ARM so much saturated by PoW, so let's divide by 2
const cpus = os.cpus()
if (os.arch().match(/arm/) || cpus[0].model.match(/Atom/)) {
stuff.newPoW.conf.nbCores /= 2; // Make sure that only once each physical core is used (for Hyperthreading).
}
return await this.cluster.proveByWorkers(stuff)
}
......
......@@ -444,6 +444,7 @@ function commandLineConf(program:any, conf:any = {}) {
const cli = {
currency: program.currency,
cpu: program.cpu,
nbCores: program.nbCores,
prefix: program.prefix,
server: {
port: program.port,
......
......@@ -3,7 +3,7 @@
// const co = require('co');
// const limiter = require('../../app/lib/system/limiter');
// const toolbox = require('../integration/tools/toolbox');
// const user = require('../integration/tools/user');
// const TestUser = require('../integration/tools/TestUser').TestUser
// const bma = require('../lib/bma');
//
// limiter.noLimit();
......
......@@ -3,7 +3,7 @@
// const co = require('co');
// const limiter = require('../lib/limiter');
// const toolbox = require('../integration/tools/toolbox');
// const user = require('../integration/tools/user');
// const TestUser = require('../integration/tools/TestUser').TestUser
// const bma = require('duniter-bma').duniter.methods.bma;
//
// limiter.noLimit();
......@@ -15,7 +15,7 @@
// }
// });
//
// const cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
// const cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
//
// let theLimiter;
//
......
......@@ -3,12 +3,12 @@ import {NewLogger} from "../../app/lib/logger"
import {BmaDependency} from "../../app/modules/bma/index"
import {CrawlerDependency} from "../../app/modules/crawler/index"
import {waitForkResolution, waitToHaveBlock} from "./tools/toolbox"
import {TestUser} from "./tools/TestUser";
const co = require('co');
const _ = require('underscore');
const duniter = require('../../index');
const bma = BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const rp = require('request-promise');
const httpTest = require('./tools/http');
const commit = require('./tools/commit');
......@@ -69,8 +69,8 @@ describe("SelfFork", function() {
}
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = new TestUser('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
const commitS1 = commit(s1);
const commitS2 = commit(s2, {
......
......@@ -4,7 +4,7 @@ const co = require('co');
const _ = require('underscore');
const duniter = require('../../index');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const rp = require('request-promise');
const httpTest = require('./tools/http');
const commit = require('./tools/commit');
......@@ -39,10 +39,10 @@ describe("Pending data", function() {
}
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
tic = user('tic', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
tuc = user('tuc', { pub: '3conGDUXdrTGbQPMQQhEC4Ubu1MCAnFrAYvUaewbUhtk', sec: '5ks7qQ8Fpkin7ycXpxQSxxjVhs8VTzpM3vEBMqM7NfC1ZiFJ93uQryDcoM93Mj77T6hDAABdeHZJDFnkDb35bgiU'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = new TestUser('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
tic = new TestUser('tic', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
tuc = new TestUser('tuc', { pub: '3conGDUXdrTGbQPMQQhEC4Ubu1MCAnFrAYvUaewbUhtk', sec: '5ks7qQ8Fpkin7ycXpxQSxxjVhs8VTzpM3vEBMqM7NfC1ZiFJ93uQryDcoM93Mj77T6hDAABdeHZJDFnkDb35bgiU'}, { server: s1 });
const commitS1 = commit(s1);
......
......@@ -3,7 +3,7 @@
const co = require('co');
const _ = require('underscore');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const toolbox = require('./tools/toolbox');
const commit = require('./tools/commit');
......@@ -32,8 +32,8 @@ describe("Revert root", function() {
sigQty: 1, dt: 1, ud0: 120
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = new TestUser('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
yield s1.initDalBmaConnections();
yield cat.createIdentity();
......
......@@ -4,7 +4,7 @@ const co = require('co');
const _ = require('underscore');
const duniter = require('../../index');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const rp = require('request-promise');
const httpTest = require('./tools/http');
const commit = require('./tools/commit');
......@@ -23,6 +23,7 @@ const MEMORY_MODE = true;
const commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
nbCores:1,
httpLogs: true,
forksize: 3,
sigQty: 1
......@@ -49,8 +50,8 @@ describe("Revert two blocks", function() {
sigQty: 1, dt: 1, ud0: 120
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = new TestUser('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
return co(function *() {
yield s1.initWithDAL().then(bma).then((bmapi) => bmapi.openConnections());
......
......@@ -3,7 +3,7 @@
const co = require('co');
const should = require('should');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const commit = require('./tools/commit');
const toolbox = require('./tools/toolbox');
......@@ -24,9 +24,9 @@ describe("Revert memberships", function() {
}
});
i1 = user('i1', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
i2 = user('i2', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
i3 = user('i3', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
i1 = new TestUser('i1', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
i2 = new TestUser('i2', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
i3 = new TestUser('i3', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
yield s1.initDalBmaConnections();
......
......@@ -6,7 +6,7 @@ const co = require('co');
const _ = require('underscore');
const duniter = require('../../index');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser;
const rp = require('request-promise');
const httpTest = require('./tools/http');
const commit = require('./tools/commit');
......@@ -43,8 +43,8 @@ describe("Switch", function () {
sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'
}
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP' }, { server: s1 });
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F' }, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP' }, { server: s1 });
toc = new TestUser('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F' }, { server: s1 });
yield s1.initWithDAL().then(bma).then((bmapi) => bmapi.openConnections());
yield s2.initWithDAL().then(bma).then((bmapi) => bmapi.openConnections());
s1.addEndpointsDefinitions(() => index_2.BmaDependency.duniter.methods.getMainEndpoint(s1.conf));
......
......@@ -6,7 +6,7 @@ const co = require('co');
const _ = require('underscore');
const duniter = require('../../index');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const rp = require('request-promise');
const httpTest = require('./tools/http');
const commit = require('./tools/commit');
......@@ -57,8 +57,8 @@ describe("Switch", function() {
}
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
toc = new TestUser('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
yield s1.initWithDAL().then(bma).then((bmapi:any) => bmapi.openConnections());
yield s2.initWithDAL().then(bma).then((bmapi:any) => bmapi.openConnections());
......
......@@ -5,7 +5,7 @@ const co = require('co');
const should = require('should');
const duniter = require('../../index');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const constants = require('../../app/lib/constants');
const rp = require('request-promise');
const httpTest = require('./tools/http');
......@@ -41,10 +41,10 @@ describe("Certification chainability", function() {
}
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
tac = user('tac', { pub: '2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc', sec: '2HuRLWgKgED1bVio1tdpeXrf7zuUszv1yPHDsDj7kcMC4rVSN9RC58ogjtKNfTbH1eFz7rn38U1PywNs3m6Q7UxE'}, { server: s1 });
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
tic = user('tic', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
tac = new TestUser('tac', { pub: '2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc', sec: '2HuRLWgKgED1bVio1tdpeXrf7zuUszv1yPHDsDj7kcMC4rVSN9RC58ogjtKNfTbH1eFz7rn38U1PywNs3m6Q7UxE'}, { server: s1 });
toc = new TestUser('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 });
tic = new TestUser('tic', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
const now = 1482220000;
......
......@@ -6,7 +6,7 @@ const assert = require('assert');
const should = require('should');
const duniter = require('../../index');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const constants = require('../../app/lib/constants');
const toolbox = require('./tools/toolbox');
......@@ -29,9 +29,9 @@ describe("Certifier must be a member", function() {
medianTimeBlocks: 1
});
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
tac = user('tac', { pub: '2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc', sec: '2HuRLWgKgED1bVio1tdpeXrf7zuUszv1yPHDsDj7kcMC4rVSN9RC58ogjtKNfTbH1eFz7rn38U1PywNs3m6Q7UxE'}, { server: s1 });
tic = user('tic', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
tac = new TestUser('tac', { pub: '2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc', sec: '2HuRLWgKgED1bVio1tdpeXrf7zuUszv1yPHDsDj7kcMC4rVSN9RC58ogjtKNfTbH1eFz7rn38U1PywNs3m6Q7UxE'}, { server: s1 });
tic = new TestUser('tic', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
yield s1.initDalBmaConnections();
yield cat.createIdentity();
......
......@@ -4,7 +4,7 @@ const co = require('co');
const _ = require('underscore');
const duniter = require('../../index');
const bma = require('../../app/modules/bma').BmaDependency.duniter.methods.bma;
const user = require('./tools/user');
const TestUser = require('./tools/TestUser').TestUser
const commit = require('./tools/commit');
const httpTest = require('./tools/http');
const shutDownEngine = require('./tools/shutDownEngine');
......@@ -40,8 +40,8 @@ describe("Community collapse", function() {
sigQty: 1, dt: 100, ud0: 120, sigValidity: 1
}, commonConf));
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
tac = user('tac', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
cat = new TestUser('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 });
tac = new TestUser('tac', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 });
return co(function *() {
yield s1.initWithDAL().then(bma).then((bmapi) => bmapi.openConnections());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment