Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ddorgan
polkadot
Commits
08144080
Commit
08144080
authored
Oct 23, 2019
by
André Silva
Committed by
Gavin Wood
Oct 23, 2019
Browse files
Update to latest substrate master (#491)
* update to latest substrate master * Fix compilation
parent
aa63bc65
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Cargo.lock
View file @
08144080
This diff is collapsed.
Click to expand it.
network/Cargo.toml
View file @
08144080
...
...
@@ -16,6 +16,7 @@ substrate-network = { git = "https://github.com/paritytech/substrate", branch =
substrate-primitives
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"polkadot-master"
}
sr-primitives
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"polkadot-master"
}
futures
=
"0.1"
futures03
=
{
package
=
"futures-preview"
,
version
=
"0.3.0-alpha.19"
,
features
=
["compat"]
}
log
=
"0.4"
exit-future
=
"0.1.4"
substrate-client
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"polkadot-master"
}
...
...
network/src/lib.rs
View file @
08144080
...
...
@@ -26,8 +26,9 @@ pub mod validation;
pub
mod
gossip
;
use
codec
::{
Decode
,
Encode
};
use
futures
::
sync
::
{
oneshot
,
mpsc
}
;
use
futures
::
sync
::
oneshot
;
use
futures
::
prelude
::
*
;
use
futures03
::{
channel
::
mpsc
,
compat
::
Compat
,
StreamExt
};
use
polkadot_primitives
::{
Block
,
Hash
,
Header
};
use
polkadot_primitives
::
parachain
::{
Id
as
ParaId
,
BlockData
,
CollatorId
,
CandidateReceipt
,
Collation
,
PoVBlock
,
...
...
@@ -108,7 +109,7 @@ impl NetworkService for PolkadotNetworkService {
Err
(
_
)
=>
mpsc
::
unbounded
()
.1
,
// return empty channel.
};
GossipMessageStream
::
new
(
topic_stream
)
GossipMessageStream
::
new
(
Box
::
new
(
Compat
::
new
(
topic_stream
.map
(
Ok
)))
)
}
fn
gossip_message
(
&
self
,
topic
:
Hash
,
message
:
GossipMessage
)
{
...
...
@@ -151,14 +152,14 @@ impl GossipService for consensus_gossip::ConsensusGossip<Block> {
/// A stream of gossip messages and an optional sender for a topic.
pub
struct
GossipMessageStream
{
topic_stream
:
mpsc
::
UnboundedReceiver
<
TopicNotification
>
,
topic_stream
:
Box
<
dyn
Stream
<
Item
=
TopicNotification
,
Error
=
()
>
+
Send
>
,
}
impl
GossipMessageStream
{
/// Create a new instance with the given topic stream.
pub
fn
new
(
topic_stream
:
mpsc
::
UnboundedReceiver
<
TopicNotification
>
)
->
Self
{
pub
fn
new
(
topic_stream
:
Box
<
dyn
Stream
<
Item
=
TopicNotification
,
Error
=
()
>
+
Send
>
)
->
Self
{
Self
{
topic_stream
topic_stream
,
}
}
}
...
...
network/src/tests/validation.rs
View file @
08144080
...
...
@@ -148,7 +148,7 @@ impl NetworkService for TestNetwork {
fn
gossip_messages_for
(
&
self
,
topic
:
Hash
)
->
GossipMessageStream
{
let
(
tx
,
rx
)
=
mpsc
::
unbounded
();
let
_
=
self
.gossip.send_listener
.unbounded_send
((
topic
,
tx
));
GossipMessageStream
::
new
(
rx
)
GossipMessageStream
::
new
(
Box
::
new
(
rx
)
)
}
fn
gossip_message
(
&
self
,
topic
:
Hash
,
message
:
GossipMessage
)
{
...
...
parachain/src/lib.rs
View file @
08144080
...
...
@@ -54,7 +54,7 @@ pub mod wasm_api;
use
rstd
::
vec
::
Vec
;
use
codec
::{
Encode
,
Decode
,
CompactAs
};
use
substrate_primitives
::
TypeId
;
use
substrate_primitives
::
{
RuntimeDebug
,
TypeId
}
;
/// Validation parameters for evaluating the parachain validity function.
// TODO: balance downloads (https://github.com/paritytech/polkadot/issues/220)
...
...
@@ -79,8 +79,11 @@ pub struct ValidationResult {
}
/// Unique identifier of a parachain.
#[derive(PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
Default,
Clone,
Copy,
Encode,
Decode,
CompactAs)]
#[cfg_attr(feature
=
"std"
,
derive(serde::Serialize,
serde::Deserialize,
Debug))]
#[derive(
Clone,
CompactAs,
Copy,
Decode,
Default,
Encode,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
RuntimeDebug
)]
#[cfg_attr(feature
=
"std"
,
derive(serde::Serialize,
serde::Deserialize))]
pub
struct
Id
(
u32
);
impl
TypeId
for
Id
{
...
...
primitives/src/parachain.rs
View file @
08144080
...
...
@@ -27,6 +27,7 @@ use serde::{Serialize, Deserialize};
#[cfg(feature
=
"std"
)]
use
primitives
::
bytes
;
use
primitives
::
RuntimeDebug
;
use
application_crypto
::
KeyTypeId
;
pub
use
polkadot_parachain
::{
...
...
@@ -102,8 +103,7 @@ pub trait ActiveParas {
}
/// Description of how often/when this parachain is scheduled for progression.
#[derive(Encode,
Decode,
Clone,
PartialEq,
Eq)]
#[cfg_attr(feature
=
"std"
,
derive(Debug))]
#[derive(Encode,
Decode,
Clone,
PartialEq,
Eq,
RuntimeDebug)]
pub
enum
Scheduling
{
/// Scheduled every block.
Always
,
...
...
@@ -112,8 +112,7 @@ pub enum Scheduling {
}
/// Information regarding a deployed parachain/thread.
#[derive(Encode,
Decode,
Clone,
PartialEq,
Eq)]
#[cfg_attr(feature
=
"std"
,
derive(Debug))]
#[derive(Encode,
Decode,
Clone,
PartialEq,
Eq,
RuntimeDebug)]
pub
struct
Info
{
/// Scheduling info.
pub
scheduling
:
Scheduling
,
...
...
@@ -429,8 +428,7 @@ pub enum ValidityAttestation {
}
/// An attested candidate.
#[derive(Clone,
PartialEq,
Decode,
Encode)]
#[cfg_attr(feature
=
"std"
,
derive(Debug))]
#[derive(Clone,
PartialEq,
Decode,
Encode,
RuntimeDebug)]
pub
struct
AttestedCandidate
{
/// The candidate data.
pub
candidate
:
CandidateReceipt
,
...
...
runtime/src/attestations.rs
View file @
08144080
...
...
@@ -24,6 +24,7 @@ use codec::{Encode, Decode};
use
srml_support
::{
decl_storage
,
decl_module
,
ensure
,
dispatch
::
Result
,
traits
::
Get
};
use
primitives
::{
Hash
,
parachain
::{
AttestedCandidate
,
CandidateReceipt
,
Id
as
ParaId
}};
use
sr_primitives
::
RuntimeDebug
;
use
sr_staking_primitives
::
SessionIndex
;
use
inherents
::{
ProvideInherent
,
InherentData
,
RuntimeString
,
MakeFatalError
,
InherentIdentifier
};
...
...
@@ -53,8 +54,7 @@ pub struct BlockAttestations<T: Trait> {
}
/// Additional attestations on a parachain block, after it was included.
#[derive(Encode,
Decode,
Clone,
PartialEq)]
#[cfg_attr(feature
=
"std"
,
derive(Debug))]
#[derive(Encode,
Decode,
Clone,
PartialEq,
RuntimeDebug)]
pub
struct
MoreAttestations
;
/// Something which processes rewards for received attestations.
...
...
runtime/src/claims.rs
View file @
08144080
...
...
@@ -86,11 +86,10 @@ impl PartialEq for EcdsaSignature {
}
}
#[cfg(feature
=
"std"
)]
impl
std
::
fmt
::
Debug
for
EcdsaSignature
{
fn
fmt
(
&
self
,
f
:
&
mut
std
::
fmt
::
Formatter
<
'_
>
)
->
std
::
fmt
::
Result
{
write!
(
f
,
"{:?}"
,
&
self
.0
[
..
])
}
impl
rstd
::
fmt
::
Debug
for
EcdsaSignature
{
fn
fmt
(
&
self
,
f
:
&
mut
rstd
::
fmt
::
Formatter
<
'_
>
)
->
rstd
::
fmt
::
Result
{
write!
(
f
,
"EcdsaSignature({:?})"
,
&
self
.0
[
..
])
}
}
decl_event!
(
...
...
runtime/src/lib.rs
View file @
08144080
...
...
@@ -40,7 +40,8 @@ use client::{
runtime_api
as
client_api
,
impl_runtime_apis
,
};
use
sr_primitives
::{
ApplyResult
,
generic
,
Permill
,
Perbill
,
impl_opaque_keys
,
create_runtime_str
,
key_types
,
create_runtime_str
,
generic
,
impl_opaque_keys
,
key_types
,
ApplyResult
,
Permill
,
Perbill
,
RuntimeDebug
,
transaction_validity
::{
TransactionValidity
,
InvalidTransaction
,
TransactionValidityError
},
weights
::{
Weight
,
DispatchInfo
},
curve
::
PiecewiseLinear
,
traits
::{
BlakeTwo256
,
Block
as
BlockT
,
StaticLookup
,
SignedExtension
},
...
...
@@ -118,8 +119,7 @@ pub fn native_version() -> NativeVersion {
///
/// RELEASE: This is only relevant for the initial PoA run-in period and may be removed
/// from the release runtime.
#[derive(Default,
Encode,
Decode,
Clone,
Eq,
PartialEq)]
#[cfg_attr(feature
=
"std"
,
derive(Debug))]
#[derive(Default,
Encode,
Decode,
Clone,
Eq,
PartialEq,
RuntimeDebug)]
pub
struct
OnlyStakingAndClaims
;
impl
SignedExtension
for
OnlyStakingAndClaims
{
type
AccountId
=
AccountId
;
...
...
runtime/src/registrar.rs
View file @
08144080
...
...
@@ -484,7 +484,6 @@ impl<T: Trait> ActiveParas for Module<T> {
pub
struct
LimitParathreadCommits
<
T
:
Trait
+
Send
+
Sync
>
(
rstd
::
marker
::
PhantomData
<
T
>
)
where
<
T
as
system
::
Trait
>
::
Call
:
IsSubType
<
Module
<
T
>
,
T
>
;
#[cfg(feature
=
"std"
)]
impl
<
T
:
Trait
+
Send
+
Sync
>
rstd
::
fmt
::
Debug
for
LimitParathreadCommits
<
T
>
where
<
T
as
system
::
Trait
>
::
Call
:
IsSubType
<
Module
<
T
>
,
T
>
{
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment