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

[enh] #854 Add "wasMember" field on /wot/requirements

parent 3b5f237a
Branches
Tags
No related merge requests found
...@@ -265,6 +265,7 @@ function BlockchainService (server) { ...@@ -265,6 +265,7 @@ function BlockchainService (server) {
let expired = false; let expired = false;
let outdistanced = false; let outdistanced = false;
let isSentry = false; let isSentry = false;
let wasMember = false;
let expiresMS = 0; let expiresMS = 0;
let expiresPending = 0; let expiresPending = 0;
let certs = []; let certs = [];
...@@ -310,6 +311,7 @@ function BlockchainService (server) { ...@@ -310,6 +311,7 @@ function BlockchainService (server) {
expiresPending = conf.msValidity; expiresPending = conf.msValidity;
} }
} }
wasMember = idty.wasMember;
isSentry = idty.member && (yield dal.isSentry(idty.pub, conf)); isSentry = idty.member && (yield dal.isSentry(idty.pub, conf));
// Expiration of certifications // Expiration of certifications
for (const cert of certs) { for (const cert of certs) {
...@@ -335,6 +337,7 @@ function BlockchainService (server) { ...@@ -335,6 +337,7 @@ function BlockchainService (server) {
expired: expired, expired: expired,
outdistanced: outdistanced, outdistanced: outdistanced,
isSentry: isSentry, isSentry: isSentry,
wasMember: wasMember,
certifications: certs, certifications: certs,
membershipPendingExpiresIn: expiresPending, membershipPendingExpiresIn: expiresPending,
membershipExpiresIn: expiresMS membershipExpiresIn: expiresMS
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
"colors": "1.1.2", "colors": "1.1.2",
"commander": "2.9.0", "commander": "2.9.0",
"daemonize2": "0.4.2", "daemonize2": "0.4.2",
"duniter-bma": "^1.0.0", "duniter-bma": "^1.0.1",
"duniter-common": "^1.0.0", "duniter-common": "^1.0.0",
"duniter-crawler": "^1.0.0", "duniter-crawler": "^1.0.0",
"duniter-keypair": "^1.0.0", "duniter-keypair": "^1.0.0",
......
...@@ -217,6 +217,7 @@ describe("Identities collision", function() { ...@@ -217,6 +217,7 @@ describe("Identities collision", function() {
res.identities[0].should.have.property('pubkey').equal('HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd'); res.identities[0].should.have.property('pubkey').equal('HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd');
res.identities[0].should.have.property('uid').equal('cat'); res.identities[0].should.have.property('uid').equal('cat');
res.identities[0].should.have.property('meta').property('timestamp'); res.identities[0].should.have.property('meta').property('timestamp');
res.identities[0].should.have.property('wasMember').equal(true);
res.identities[0].should.have.property('expired').equal(false); // Because it has been a member once! So its identity will exist forever. res.identities[0].should.have.property('expired').equal(false); // Because it has been a member once! So its identity will exist forever.
res.identities[0].should.have.property('outdistanced').equal(false); res.identities[0].should.have.property('outdistanced').equal(false);
res.identities[0].should.have.property('isSentry').equal(true); // dSen = 2, cat has issued and received 2 certs with tic and toc res.identities[0].should.have.property('isSentry').equal(true); // dSen = 2, cat has issued and received 2 certs with tic and toc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment