mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Update to latest Substrate master (#320)
* Make `collator::Network` require `Send + Sync` to make it work * Update packages * Update to latest Substrate * Make it compile and make tests work * Use `polkadot-master` * Fix CI * Remove `build.sh` from readmes * Delete old stuff * Bring one back
This commit is contained in:
committed by
André Silva
parent
d99f721540
commit
c0b065837e
+11
-19
@@ -33,9 +33,8 @@ use polkadot_primitives::parachain::{
|
||||
StructuredUnroutedIngress,
|
||||
};
|
||||
use substrate_network::{
|
||||
PeerId, RequestId, Context, Event, message, generic_message,
|
||||
specialization::NetworkSpecialization as Specialization,
|
||||
StatusMessage as GenericFullStatus
|
||||
PeerId, RequestId, Context, StatusMessage as GenericFullStatus,
|
||||
specialization::{Event, NetworkSpecialization as Specialization},
|
||||
};
|
||||
use self::validation::{LiveValidationSessions, RecentValidatorIds, InsertedRecentKey};
|
||||
use self::collator_pool::{CollatorPool, Role, Action};
|
||||
@@ -573,24 +572,17 @@ impl Specialization<Block> for PolkadotProtocol {
|
||||
&mut self,
|
||||
ctx: &mut dyn Context<Block>,
|
||||
who: PeerId,
|
||||
message: &mut Option<message::Message<Block>>
|
||||
message: Vec<u8>,
|
||||
) {
|
||||
match message.take() {
|
||||
Some(generic_message::Message::ChainSpecific(raw)) => {
|
||||
match Message::decode(&mut raw.as_slice()) {
|
||||
Some(msg) => {
|
||||
ctx.report_peer(who.clone(), benefit::VALID_FORMAT);
|
||||
self.on_polkadot_message(ctx, who, msg)
|
||||
},
|
||||
None => {
|
||||
trace!(target: "p_net", "Bad message from {}", who);
|
||||
ctx.report_peer(who, cost::INVALID_FORMAT);
|
||||
*message = Some(generic_message::Message::ChainSpecific(raw));
|
||||
}
|
||||
}
|
||||
match Message::decode(&mut &message[..]) {
|
||||
Some(msg) => {
|
||||
ctx.report_peer(who.clone(), benefit::VALID_FORMAT);
|
||||
self.on_polkadot_message(ctx, who, msg)
|
||||
},
|
||||
None => {
|
||||
trace!(target: "p_net", "Bad message from {}", who);
|
||||
ctx.report_peer(who, cost::INVALID_FORMAT);
|
||||
}
|
||||
Some(other) => *message = Some(other),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user