Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
duniter-currency-monit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
modules
duniter-currency-monit
Commits
7f7ccfab
Commit
7f7ccfab
authored
5 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[test] add a `willMembers` basic test
parent
c3845404
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/will-members.ts
+55
-0
55 additions, 0 deletions
test/will-members.ts
with
55 additions
and
0 deletions
test/will-members.ts
0 → 100644
+
55
−
0
View file @
7f7ccfab
// 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
})
}))
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