Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
c52bf9b2
Commit
c52bf9b2
authored
8 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[fix]
#909
Implicit revocation was generating a wring MINDEX
parent
3020174a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/dup/indexer.js
+2
-1
2 additions, 1 deletion
app/lib/dup/indexer.js
test/integration/identity-implicit-revocation.js
+78
-0
78 additions, 0 deletions
test/integration/identity-implicit-revocation.js
with
80 additions
and
1 deletion
app/lib/dup/indexer.js
+
2
−
1
View file @
c52bf9b2
...
@@ -1442,7 +1442,8 @@ const indexer = module.exports = {
...
@@ -1442,7 +1442,8 @@ const indexer = module.exports = {
if
(
REDUCED
.
revokes_on
<=
HEAD
.
medianTime
&&
!
REDUCED
.
revoked_on
)
{
if
(
REDUCED
.
revokes_on
<=
HEAD
.
medianTime
&&
!
REDUCED
.
revoked_on
)
{
revocations
.
push
({
revocations
.
push
({
op
:
'
UPDATE
'
,
op
:
'
UPDATE
'
,
pub
:
MS
.
receiver
,
pub
:
MS
.
pub
,
created_on
:
REDUCED
.
created_on
,
written_on
:
[
HEAD
.
number
,
HEAD
.
hash
].
join
(
'
-
'
),
written_on
:
[
HEAD
.
number
,
HEAD
.
hash
].
join
(
'
-
'
),
revoked_on
:
HEAD
.
medianTime
revoked_on
:
HEAD
.
medianTime
});
});
...
...
This diff is collapsed.
Click to expand it.
test/integration/identity-implicit-revocation.js
0 → 100644
+
78
−
0
View file @
c52bf9b2
"
use strict
"
;
const
_
=
require
(
'
underscore
'
);
const
co
=
require
(
'
co
'
);
const
assert
=
require
(
'
assert
'
);
const
should
=
require
(
'
should
'
);
const
duniter
=
require
(
'
../../index
'
);
const
bma
=
require
(
'
duniter-bma
'
).
duniter
.
methods
.
bma
;
const
user
=
require
(
'
./tools/user
'
);
const
constants
=
require
(
'
../../app/lib/constants
'
);
const
toolbox
=
require
(
'
./tools/toolbox
'
);
const
now
=
1480000000
;
const
s1
=
toolbox
.
server
({
pair
:
{
pub
:
'
HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd
'
,
sec
:
'
51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP
'
},
sigValidity
:
100
,
msValidity
:
10
,
sigQty
:
1
,
medianTimeBlocks
:
1
});
const
cat
=
user
(
'
cat
'
,
{
pub
:
'
HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd
'
,
sec
:
'
51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP
'
},
{
server
:
s1
});
const
tac
=
user
(
'
tac
'
,
{
pub
:
'
2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc
'
,
sec
:
'
2HuRLWgKgED1bVio1tdpeXrf7zuUszv1yPHDsDj7kcMC4rVSN9RC58ogjtKNfTbH1eFz7rn38U1PywNs3m6Q7UxE
'
},
{
server
:
s1
});
const
tic
=
user
(
'
tic
'
,
{
pub
:
'
DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV
'
,
sec
:
'
468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7
'
},
{
server
:
s1
});
describe
(
"
Implicit revocation
"
,
function
()
{
before
(()
=>
co
(
function
*
()
{
yield
s1
.
initWithDAL
().
then
(
bma
).
then
((
bmapi
)
=>
bmapi
.
openConnections
());
yield
cat
.
createIdentity
();
yield
tac
.
createIdentity
();
yield
tic
.
createIdentity
();
yield
cat
.
cert
(
tac
);
yield
tac
.
cert
(
tic
);
yield
tic
.
cert
(
cat
);
yield
cat
.
join
();
yield
tac
.
join
();
yield
tic
.
join
();
yield
s1
.
commit
({
time
:
now
});
yield
s1
.
commit
({
time
:
now
+
8
});
yield
s1
.
commit
({
time
:
now
+
9
});
yield
cat
.
join
();
yield
tac
.
join
();
yield
s1
.
commit
({
time
:
now
+
10
});
yield
s1
.
commit
({
time
:
now
+
10
});
yield
s1
.
commit
({
time
:
now
+
11
});
yield
s1
.
commit
({
time
:
now
+
15
});
yield
s1
.
commit
({
time
:
now
+
15
});
yield
cat
.
join
();
yield
tac
.
join
();
yield
s1
.
commit
({
time
:
now
+
20
});
yield
s1
.
commit
({
time
:
now
+
20
});
}));
it
(
'
block#4 should have kicked tic
'
,
()
=>
s1
.
expectThat
(
'
/blockchain/block/5
'
,
(
res
)
=>
{
assert
.
deepEqual
(
res
.
excluded
,
[
'
DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV
'
]);
}));
it
(
'
should exist implicit revocation traces
'
,
()
=>
co
(
function
*
()
{
const
ms
=
yield
s1
.
dal
.
mindexDAL
.
getReducedMS
(
'
DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV
'
)
ms
.
should
.
have
.
property
(
'
revoked_on
'
).
equal
(
1480000020
)
}));
it
(
'
should answer that tic is revoked on API
'
,
()
=>
s1
.
expectThat
(
'
/wot/lookup/tic
'
,
(
res
)
=>
{
res
.
should
.
have
.
property
(
'
results
'
).
length
(
1
);
res
.
results
[
0
].
should
.
have
.
property
(
'
uids
'
).
length
(
1
);
res
.
results
[
0
].
uids
[
0
].
should
.
have
.
property
(
'
uid
'
).
equal
(
'
tic
'
);
res
.
results
[
0
].
uids
[
0
].
should
.
have
.
property
(
'
revoked
'
).
equal
(
true
);
res
.
results
[
0
].
uids
[
0
].
should
.
have
.
property
(
'
revoked_on
'
).
equal
(
1480000020
);
res
.
results
[
0
].
uids
[
0
].
should
.
have
.
property
(
'
revocation_sig
'
).
equal
(
null
);
}));
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment