Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
parity
Mirrored projects
polkadot-sdk
Commits
c8a03906
Commit
c8a03906
authored
4 years ago
by
Bastian Köcher
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Companion for Substrate #6508 (#1329)
* Companion for Substrate #6508 * Update Cargo.lock
parent
d16e7485
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
polkadot/Cargo.lock
+136
-136
136 additions, 136 deletions
polkadot/Cargo.lock
polkadot/network/test/src/block_import.rs
+4
-4
4 additions, 4 deletions
polkadot/network/test/src/block_import.rs
polkadot/network/test/src/lib.rs
+3
-3
3 additions, 3 deletions
polkadot/network/test/src/lib.rs
with
143 additions
and
143 deletions
polkadot/Cargo.lock
+
136
−
136
View file @
c8a03906
This diff is collapsed.
Click to expand it.
polkadot/network/test/src/block_import.rs
+
4
−
4
View file @
c8a03906
...
...
@@ -60,7 +60,7 @@ fn import_single_good_block_works() {
let
mut
expected_aux
=
ImportedAux
::
default
();
expected_aux
.is_new_best
=
true
;
match
import_single_block
(
&
mut
polkadot_test_runtime_client
::
new
(),
BlockOrigin
::
File
,
block
,
&
mut
PassThroughVerifier
(
true
))
{
match
import_single_block
(
&
mut
polkadot_test_runtime_client
::
new
(),
BlockOrigin
::
File
,
block
,
&
mut
PassThroughVerifier
::
new
(
true
))
{
Ok
(
BlockImportResult
::
ImportedUnknown
(
ref
num
,
ref
aux
,
ref
org
))
if
*
num
==
number
as
u32
&&
*
aux
==
expected_aux
&&
*
org
==
Some
(
peer_id
)
=>
{}
r
@
_
=>
panic!
(
"{:?}"
,
r
)
...
...
@@ -70,7 +70,7 @@ fn import_single_good_block_works() {
#[test]
fn
import_single_good_known_block_is_ignored
()
{
let
(
mut
client
,
_hash
,
number
,
_
,
block
)
=
prepare_good_block
();
match
import_single_block
(
&
mut
client
,
BlockOrigin
::
File
,
block
,
&
mut
PassThroughVerifier
(
true
))
{
match
import_single_block
(
&
mut
client
,
BlockOrigin
::
File
,
block
,
&
mut
PassThroughVerifier
::
new
(
true
))
{
Ok
(
BlockImportResult
::
ImportedKnown
(
ref
n
))
if
*
n
==
number
as
u32
=>
{}
_
=>
panic!
()
}
...
...
@@ -80,7 +80,7 @@ fn import_single_good_known_block_is_ignored() {
fn
import_single_good_block_without_header_fails
()
{
let
(
_
,
_
,
_
,
peer_id
,
mut
block
)
=
prepare_good_block
();
block
.header
=
None
;
match
import_single_block
(
&
mut
polkadot_test_runtime_client
::
new
(),
BlockOrigin
::
File
,
block
,
&
mut
PassThroughVerifier
(
true
))
{
match
import_single_block
(
&
mut
polkadot_test_runtime_client
::
new
(),
BlockOrigin
::
File
,
block
,
&
mut
PassThroughVerifier
::
new
(
true
))
{
Err
(
BlockImportError
::
IncompleteHeader
(
ref
org
))
if
*
org
==
Some
(
peer_id
)
=>
{}
_
=>
panic!
()
}
...
...
@@ -91,7 +91,7 @@ fn async_import_queue_drops() {
let
executor
=
sp_core
::
testing
::
SpawnBlockingExecutor
::
new
();
// Perform this test multiple times since it exhibits non-deterministic behavior.
for
_
in
0
..
100
{
let
verifier
=
PassThroughVerifier
(
true
);
let
verifier
=
PassThroughVerifier
::
new
(
true
);
let
queue
=
BasicQueue
::
new
(
verifier
,
...
...
This diff is collapsed.
Click to expand it.
polkadot/network/test/src/lib.rs
+
3
−
3
View file @
c8a03906
...
...
@@ -600,7 +600,7 @@ pub trait TestNetFactory: Sized {
transaction_pool
:
Arc
::
new
(
EmptyTransactionPool
),
protocol_id
:
ProtocolId
::
from
(
&
b"test-protocol-name"
[
..
]),
import_queue
,
block_announce_validator
:
Box
::
new
(
DefaultBlockAnnounceValidator
::
new
(
client
.clone
())
),
block_announce_validator
:
Box
::
new
(
DefaultBlockAnnounceValidator
),
metrics_registry
:
None
,
})
.unwrap
();
...
...
@@ -677,7 +677,7 @@ pub trait TestNetFactory: Sized {
transaction_pool
:
Arc
::
new
(
EmptyTransactionPool
),
protocol_id
:
ProtocolId
::
from
(
&
b"test-protocol-name"
[
..
]),
import_queue
,
block_announce_validator
:
Box
::
new
(
DefaultBlockAnnounceValidator
::
new
(
client
.clone
())
),
block_announce_validator
:
Box
::
new
(
DefaultBlockAnnounceValidator
),
metrics_registry
:
None
,
})
.unwrap
();
...
...
@@ -804,7 +804,7 @@ impl TestNetFactory for TestNet {
fn
make_verifier
(
&
self
,
_client
:
PeersClient
,
_config
:
&
ProtocolConfig
,
_peer_data
:
&
())
->
Self
::
Verifier
{
PassThroughVerifier
(
false
)
PassThroughVerifier
::
new
(
false
)
}
fn
peer
(
&
mut
self
,
i
:
usize
)
->
&
mut
Peer
<
()
>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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