Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
timothe
duniter
Commits
85bad8dd
Commit
85bad8dd
authored
Jan 15, 2020
by
Cédric Moreau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] `search [pattern]` command: add exclusions display
parent
d4834c7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
app/modules/dump.ts
app/modules/dump.ts
+8
-1
No files found.
app/modules/dump.ts
View file @
85bad8dd
...
...
@@ -164,7 +164,7 @@ module.exports = {
const
blocks
=
Underscore
.
sortBy
(
await
findBlocksMatching
(
pattern
,
files
),
b
=>
b
.
number
)
const
events
:
{
b
:
BlockDTO
,
event
:
(
IdentityDTO
|
ShortCertificationDTO
|
MembershipDTO
|
ShortRevocation
)
}[]
=
[]
const
events
:
{
b
:
BlockDTO
,
event
:
(
IdentityDTO
|
ShortCertificationDTO
|
MembershipDTO
|
ShortRevocation
|
{
type
:
'
exclusion
'
,
pub
:
string
}
)
}[]
=
[]
for
(
const
b
of
blocks
)
{
b
.
identities
.
filter
(
i
=>
i
.
includes
(
pattern
)).
forEach
(
i
=>
{
events
.
push
({
b
,
event
:
IdentityDTO
.
fromInline
(
i
)
})
...
...
@@ -178,6 +178,9 @@ module.exports = {
b
.
revoked
.
filter
(
m
=>
m
.
includes
(
pattern
)).
forEach
(
r
=>
{
events
.
push
({
b
,
event
:
RevocationDTO
.
fromInline
(
r
)
})
})
b
.
excluded
.
filter
(
m
=>
m
.
includes
(
pattern
)).
forEach
(
r
=>
{
events
.
push
({
b
,
event
:
{
type
:
'
exclusion
'
,
pub
:
r
}
})
})
}
for
(
const
e
of
events
)
{
...
...
@@ -186,6 +189,10 @@ module.exports = {
const
idty
=
e
.
event
as
IdentityDTO
console
.
log
(
'
%s: new identity %s (created on %s)
'
,
date
,
idty
.
uid
,
await
getDateFor
(
server
,
idty
.
buid
as
string
))
}
if
((
e
.
event
as
{
type
:
'
exclusion
'
,
pub
:
string
}).
type
===
'
exclusion
'
)
{
const
date
=
await
getDateForBlock
(
e
.
b
)
console
.
log
(
'
%s: excluded
'
,
date
)
}
}
console
.
log
(
events
.
map
(
e
=>
e
.
event
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment