mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-04 08:07:24 +00:00
Update to Substrate master (#176)
* Update to master This introduces a new type `CollatorId`, currently just `SessionKey` but which would forseeably change to its own thing. It seems to work like this (despite there being a lot of the new-incompatible `AccountId` replaced). No idea if it does anything sensible, though. * Cleanups * Fix tests * Remove commented code * Specify commit hash * Remove commented code * Correct version * Update runtime/Cargo.toml Co-Authored-By: gavofyork <github@gavwood.com> * PairT instead of _Pair * Update lock file * Remove rev causing upset
This commit is contained in:
@@ -33,7 +33,7 @@ use futures::{future, prelude::*};
|
||||
|
||||
use super::{GroupInfo, Incoming, TableRouter};
|
||||
use self::includable::IncludabilitySender;
|
||||
use primitives::ed25519;
|
||||
use primitives::{Pair, ed25519};
|
||||
use runtime_primitives::{traits::ProvideRuntimeApi};
|
||||
|
||||
mod includable;
|
||||
@@ -544,7 +544,8 @@ impl SharedTable {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use substrate_keyring::Keyring;
|
||||
use substrate_keyring::AuthorityKeyring;
|
||||
use primitives::crypto::UncheckedInto;
|
||||
use futures::future;
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -572,15 +573,16 @@ mod tests {
|
||||
let mut groups = HashMap::new();
|
||||
|
||||
let para_id = ParaId::from(1);
|
||||
let local_id = Keyring::Alice.to_raw_public().into();
|
||||
let local_key = Arc::new(Keyring::Alice.pair());
|
||||
|
||||
let validity_other = Keyring::Bob.to_raw_public().into();
|
||||
let validity_other_key = Keyring::Bob.pair();
|
||||
let parent_hash = Default::default();
|
||||
|
||||
let local_key = Arc::new(AuthorityKeyring::Alice.pair());
|
||||
let local_id = local_key.public();
|
||||
|
||||
let validity_other_key = AuthorityKeyring::Bob.pair();
|
||||
let validity_other = validity_other_key.public();
|
||||
|
||||
groups.insert(para_id, GroupInfo {
|
||||
validity_guarantors: [local_id, validity_other].iter().cloned().collect(),
|
||||
validity_guarantors: [local_id, validity_other.clone()].iter().cloned().collect(),
|
||||
needed_validity: 2,
|
||||
});
|
||||
|
||||
@@ -593,7 +595,7 @@ mod tests {
|
||||
|
||||
let candidate = CandidateReceipt {
|
||||
parachain_index: para_id,
|
||||
collator: [1; 32].into(),
|
||||
collator: [1; 32].unchecked_into(),
|
||||
signature: Default::default(),
|
||||
head_data: ::polkadot_primitives::parachain::HeadData(vec![1, 2, 3, 4]),
|
||||
balance_uploads: Vec::new(),
|
||||
@@ -622,15 +624,16 @@ mod tests {
|
||||
let mut groups = HashMap::new();
|
||||
|
||||
let para_id = ParaId::from(1);
|
||||
let local_id = Keyring::Alice.to_raw_public().into();
|
||||
let local_key = Arc::new(Keyring::Alice.pair());
|
||||
|
||||
let validity_other = Keyring::Bob.to_raw_public().into();
|
||||
let validity_other_key = Keyring::Bob.pair();
|
||||
let parent_hash = Default::default();
|
||||
|
||||
let local_key = Arc::new(AuthorityKeyring::Alice.pair());
|
||||
let local_id = local_key.public();
|
||||
|
||||
let validity_other_key = AuthorityKeyring::Bob.pair();
|
||||
let validity_other = validity_other_key.public();
|
||||
|
||||
groups.insert(para_id, GroupInfo {
|
||||
validity_guarantors: [local_id, validity_other].iter().cloned().collect(),
|
||||
validity_guarantors: [local_id, validity_other.clone()].iter().cloned().collect(),
|
||||
needed_validity: 1,
|
||||
});
|
||||
|
||||
@@ -643,7 +646,7 @@ mod tests {
|
||||
|
||||
let candidate = CandidateReceipt {
|
||||
parachain_index: para_id,
|
||||
collator: [1; 32].into(),
|
||||
collator: [1; 32].unchecked_into(),
|
||||
signature: Default::default(),
|
||||
head_data: ::polkadot_primitives::parachain::HeadData(vec![1, 2, 3, 4]),
|
||||
balance_uploads: Vec::new(),
|
||||
@@ -676,7 +679,7 @@ mod tests {
|
||||
|
||||
let candidate = CandidateReceipt {
|
||||
parachain_index: para_id,
|
||||
collator: [1; 32].into(),
|
||||
collator: [1; 32].unchecked_into(),
|
||||
signature: Default::default(),
|
||||
head_data: ::polkadot_primitives::parachain::HeadData(vec![1, 2, 3, 4]),
|
||||
balance_uploads: Vec::new(),
|
||||
@@ -716,7 +719,7 @@ mod tests {
|
||||
|
||||
let candidate = CandidateReceipt {
|
||||
parachain_index: para_id,
|
||||
collator: [1; 32].into(),
|
||||
collator: [1; 32].unchecked_into(),
|
||||
signature: Default::default(),
|
||||
head_data: ::polkadot_primitives::parachain::HeadData(vec![1, 2, 3, 4]),
|
||||
balance_uploads: Vec::new(),
|
||||
@@ -751,15 +754,16 @@ mod tests {
|
||||
let mut groups = HashMap::new();
|
||||
|
||||
let para_id = ParaId::from(1);
|
||||
let local_id = Keyring::Alice.to_raw_public().into();
|
||||
let local_key = Arc::new(Keyring::Alice.pair());
|
||||
|
||||
let validity_other = Keyring::Bob.to_raw_public().into();
|
||||
let validity_other_key = Keyring::Bob.pair();
|
||||
let parent_hash = Default::default();
|
||||
|
||||
let local_key = Arc::new(AuthorityKeyring::Alice.pair());
|
||||
let local_id = local_key.public();
|
||||
|
||||
let validity_other_key = AuthorityKeyring::Bob.pair();
|
||||
let validity_other = validity_other_key.public();
|
||||
|
||||
groups.insert(para_id, GroupInfo {
|
||||
validity_guarantors: [local_id, validity_other].iter().cloned().collect(),
|
||||
validity_guarantors: [local_id, validity_other.clone()].iter().cloned().collect(),
|
||||
needed_validity: 1,
|
||||
});
|
||||
|
||||
@@ -772,7 +776,7 @@ mod tests {
|
||||
|
||||
let candidate = CandidateReceipt {
|
||||
parachain_index: para_id,
|
||||
collator: [1; 32].into(),
|
||||
collator: [1; 32].unchecked_into(),
|
||||
signature: Default::default(),
|
||||
head_data: ::polkadot_primitives::parachain::HeadData(vec![1, 2, 3, 4]),
|
||||
balance_uploads: Vec::new(),
|
||||
@@ -811,14 +815,16 @@ mod tests {
|
||||
let mut groups = HashMap::new();
|
||||
|
||||
let para_id = ParaId::from(1);
|
||||
let local_id = Keyring::Alice.to_raw_public().into();
|
||||
let local_key = Arc::new(Keyring::Alice.pair());
|
||||
let block_data = BlockData(vec![1, 2, 3]);
|
||||
let extrinsic = Extrinsic { outgoing_messages: Vec::new() };
|
||||
|
||||
let validity_other = Keyring::Bob.to_raw_public().into();
|
||||
let parent_hash = Default::default();
|
||||
|
||||
let local_key = Arc::new(AuthorityKeyring::Alice.pair());
|
||||
let local_id = local_key.public();
|
||||
|
||||
let validity_other_key = AuthorityKeyring::Bob.pair();
|
||||
let validity_other = validity_other_key.public();
|
||||
|
||||
groups.insert(para_id, GroupInfo {
|
||||
validity_guarantors: [local_id, validity_other].iter().cloned().collect(),
|
||||
needed_validity: 1,
|
||||
@@ -833,7 +839,7 @@ mod tests {
|
||||
|
||||
let candidate = CandidateReceipt {
|
||||
parachain_index: para_id,
|
||||
collator: [1; 32].into(),
|
||||
collator: [1; 32].unchecked_into(),
|
||||
signature: Default::default(),
|
||||
head_data: ::polkadot_primitives::parachain::HeadData(vec![1, 2, 3, 4]),
|
||||
balance_uploads: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user