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
c1dd0650
Commit
c1dd0650
authored
5 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[tests] reproduce bug
#1402
parent
b7c3c922
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
test/integration/fork-resolution/coming-back-with-less-than-sigqty.ts
+14
-5
14 additions, 5 deletions
...tion/fork-resolution/coming-back-with-less-than-sigqty.ts
test/integration/tools/TestUser.ts
+1
-1
1 addition, 1 deletion
test/integration/tools/TestUser.ts
with
15 additions
and
6 deletions
test/integration/fork-resolution/coming-back-with-less-than-sigqty.ts
+
14
−
5
View file @
c1dd0650
...
@@ -81,8 +81,17 @@ describe('A member coming back with less than `sigQty` valid certs total', () =>
...
@@ -81,8 +81,17 @@ describe('A member coming back with less than `sigQty` valid certs total', () =>
await
s1
.
commit
({
time
:
now
+
13
})
await
s1
.
commit
({
time
:
now
+
13
})
await
s1
.
commit
({
time
:
now
+
13
})
await
s1
.
commit
({
time
:
now
+
13
})
const
c1
=
await
cat
.
makeCert
(
toc
)
// <-- a renewal ==> this is what we want to observe
const
c1
=
await
cat
.
makeCert
(
toc
)
// <-- a renewal ==> this is what we want to observe
const
join
=
await
toc
.
makeMembership
(
'
IN
'
)
const
join
=
await
toc
.
makeMembership
(
'
IN
'
);
// toc is **NOT** coming back! not enough certs
// Inject c1 & join in mempool
await
cat
.
sendCert
(
c1
)
await
toc
.
sendMembership
(
join
)
// Next bloc must NOT include toc join (#1402)
const
b1
=
s1
.
commit
({
time
:
now
+
13
})
assertEqual
((
await
b1
).
joiners
.
length
,
0
);
// Try to force toc coming back, must be fail because toc not have enough certs (#1394)
await
assertThrows
(
s1
.
commit
({
await
assertThrows
(
s1
.
commit
({
time
:
now
+
13
,
time
:
now
+
13
,
joiners
:
[
join
],
joiners
:
[
join
],
...
@@ -90,13 +99,13 @@ describe('A member coming back with less than `sigQty` valid certs total', () =>
...
@@ -90,13 +99,13 @@ describe('A member coming back with less than `sigQty` valid certs total', () =>
}),
'
BLOCK_WASNT_COMMITTED
'
)
}),
'
BLOCK_WASNT_COMMITTED
'
)
// BUT is coming back with 1 more cert
// BUT is coming back with 1 more cert
const
c2
=
await
tac
.
makeCert
(
toc
)
const
c2
=
await
tac
.
makeCert
(
toc
)
const
b
=
await
s1
.
commit
({
const
b
2
=
await
s1
.
commit
({
time
:
now
+
13
,
time
:
now
+
13
,
joiners
:
[
join
],
joiners
:
[
join
],
certifications
:
[
c1
,
c2
]
certifications
:
[
c1
,
c2
]
})
})
assertEqual
(
b
.
membersCount
,
3
)
// <--- toc is welcome back :)
assertEqual
(
b
2
.
membersCount
,
3
)
// <--- toc is welcome back :)
assertEqual
(
b
.
number
,
1
2
)
assertEqual
(
b
2
.
number
,
1
3
)
})
})
after
(()
=>
{
after
(()
=>
{
...
...
This diff is collapsed.
Click to expand it.
test/integration/tools/TestUser.ts
+
1
−
1
View file @
c1dd0650
...
@@ -98,7 +98,7 @@ export class TestUser {
...
@@ -98,7 +98,7 @@ export class TestUser {
return
this
.
createdIdentity
return
this
.
createdIdentity
}
}
public
async
makeCert
(
user
:
TestUser
,
fromServer
?:
TestingServer
,
overrideProps
?:
any
)
{
public
async
makeCert
(
user
:
TestUser
,
fromServer
?:
TestingServer
,
overrideProps
?:
any
)
:
Promise
<
CertificationDTO
>
{
const
lookup
=
await
this
.
lookup
(
user
.
pub
,
fromServer
)
const
lookup
=
await
this
.
lookup
(
user
.
pub
,
fromServer
)
const
current
=
await
this
.
node
.
server
.
BlockchainService
.
current
()
const
current
=
await
this
.
node
.
server
.
BlockchainService
.
current
()
const
idty
=
Underscore
.
filter
(
lookup
.
results
[
0
].
uids
,
uidEntry
=>
uidEntry
.
uid
===
user
.
uid
)[
0
]
const
idty
=
Underscore
.
filter
(
lookup
.
results
[
0
].
uids
,
uidEntry
=>
uidEntry
.
uid
===
user
.
uid
)[
0
]
...
...
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