Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
duniter-currency-monit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nodes
typescript
modules
duniter-currency-monit
Commits
08563465
Commit
08563465
authored
Apr 19, 2020
by
Cédric Moreau
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test/willMembers'
parents
8ecfb511
fece8812
Pipeline
#8721
passed with stage
in 29 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
609 additions
and
499 deletions
+609
-499
lib/DataFinder.ts
lib/DataFinder.ts
+8
-1
modules/will-members.ts
modules/will-members.ts
+516
-0
routes/willMembers2.ts
routes/willMembers2.ts
+30
-498
test/will-members.ts
test/will-members.ts
+55
-0
No files found.
lib/DataFinder.ts
View file @
08563465
...
...
@@ -134,7 +134,14 @@ export class DataFinder {
@MonitorExecutionTime()
getUidOfPub(pub: string): Promise<{ uid: string }[]> {
return this.getFromCacheOrDB('getUidOfPub', pub, () => this.iindex.getFullFromPubkey(pub))
return this.getFromCacheOrDB('getUidOfPub', pub, async () => {
const entry = await this.iindex.getFullFromPubkey(pub)
if (!entry.uid) {
// Not found
return []
}
return [entry]
})
}
@MonitorExecutionTime()
...
...
modules/will-members.ts
0 → 100644
View file @
08563465
This diff is collapsed.
Click to expand it.
routes/willMembers2.ts
View file @
08563465
This diff is collapsed.
Click to expand it.
test/will-members.ts
0 → 100644
View file @
08563465
// Source file from duniter: Crypto-currency software to manage libre currency such as Ğ1
// Copyright (C) 2018 Cedric Moreau <cem.moreau@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
import
{
assertEqual
,
assertTrue
,
writeBasicTestWithConfAnd2Users
}
from
"
duniter/test/integration/tools/test-framework
"
import
{
CommonConstants
}
from
"
duniter/app/lib/common-libs/constants
"
;
import
{
DataFinder
,
initMonitDB
}
from
"
../lib/DataFinder
"
;
import
{
MonitDBBlock
}
from
"
../lib/SqliteBlockchain
"
;
import
{
willMembers
}
from
"
../modules/will-members
"
;
describe
(
'
willMembers
'
,
()
=>
writeBasicTestWithConfAnd2Users
({
sigQty
:
1
,
medianTimeBlocks
:
1
,
},
(
test
)
=>
{
const
now
=
1500000000
before
(()
=>
{
CommonConstants
.
BLOCKS_IN_MEMORY_MAX
=
3
// Must be > forkWindowSize
})
test
(
'
Duniter blockchain init
'
,
async
(
s1
,
cat
,
tac
)
=>
{
await
cat
.
createIdentity
()
await
tac
.
createIdentity
()
await
cat
.
cert
(
tac
)
await
tac
.
cert
(
cat
)
await
cat
.
join
()
await
tac
.
join
()
const
head
=
await
s1
.
commit
({
time
:
now
})
assertEqual
(
head
.
number
,
0
);
assertEqual
(
head
.
membersCount
,
2
);
await
initMonitDB
(
s1
.
_server
)
})
test
(
'
toc tries to join
'
,
async
(
s1
,
cat
,
tac
,
toc
)
=>
{
await
toc
.
createIdentity
()
await
toc
.
join
()
await
cat
.
cert
(
toc
)
await
tac
.
cert
(
toc
)
const
will
=
await
willMembers
(
s1
.
_server
)
assertEqual
(
will
.
idtysListOrdered
.
length
,
1
)
assertEqual
(
will
.
idtysListOrdered
[
0
].
pendingCertifications
.
length
,
2
)
// cat & tac
})
}))
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