mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 22:11:06 +00:00
Update Substrate & Polkadot (#359)
* Update Substrate & Polkadot * Remove unused code
This commit is contained in:
Generated
+258
-200
File diff suppressed because it is too large
Load Diff
@@ -44,7 +44,7 @@ use codec::{Decode, Encode};
|
|||||||
use futures::{
|
use futures::{
|
||||||
channel::oneshot,
|
channel::oneshot,
|
||||||
future::{ready, FutureExt},
|
future::{ready, FutureExt},
|
||||||
pin_mut, select, Future,
|
Future,
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::{convert::TryFrom, fmt, marker::PhantomData, pin::Pin, sync::Arc};
|
use std::{convert::TryFrom, fmt, marker::PhantomData, pin::Pin, sync::Arc};
|
||||||
@@ -474,7 +474,6 @@ where
|
|||||||
pub struct WaitToAnnounce<Block: BlockT> {
|
pub struct WaitToAnnounce<Block: BlockT> {
|
||||||
spawner: Arc<dyn SpawnNamed + Send + Sync>,
|
spawner: Arc<dyn SpawnNamed + Send + Sync>,
|
||||||
announce_block: Arc<dyn Fn(Block::Hash, Vec<u8>) + Send + Sync>,
|
announce_block: Arc<dyn Fn(Block::Hash, Vec<u8>) + Send + Sync>,
|
||||||
current_trigger: oneshot::Sender<()>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Block: BlockT> WaitToAnnounce<Block> {
|
impl<Block: BlockT> WaitToAnnounce<Block> {
|
||||||
@@ -483,12 +482,9 @@ impl<Block: BlockT> WaitToAnnounce<Block> {
|
|||||||
spawner: Arc<dyn SpawnNamed + Send + Sync>,
|
spawner: Arc<dyn SpawnNamed + Send + Sync>,
|
||||||
announce_block: Arc<dyn Fn(Block::Hash, Vec<u8>) + Send + Sync>,
|
announce_block: Arc<dyn Fn(Block::Hash, Vec<u8>) + Send + Sync>,
|
||||||
) -> WaitToAnnounce<Block> {
|
) -> WaitToAnnounce<Block> {
|
||||||
let (tx, _rx) = oneshot::channel();
|
|
||||||
|
|
||||||
WaitToAnnounce {
|
WaitToAnnounce {
|
||||||
spawner,
|
spawner,
|
||||||
announce_block,
|
announce_block,
|
||||||
current_trigger: tx,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,44 +496,23 @@ impl<Block: BlockT> WaitToAnnounce<Block> {
|
|||||||
pov_hash: PHash,
|
pov_hash: PHash,
|
||||||
signed_stmt_recv: oneshot::Receiver<SignedFullStatement>,
|
signed_stmt_recv: oneshot::Receiver<SignedFullStatement>,
|
||||||
) {
|
) {
|
||||||
let (tx, rx) = oneshot::channel();
|
|
||||||
let announce_block = self.announce_block.clone();
|
let announce_block = self.announce_block.clone();
|
||||||
|
|
||||||
self.current_trigger = tx;
|
|
||||||
|
|
||||||
self.spawner.spawn(
|
self.spawner.spawn(
|
||||||
"cumulus-wait-to-announce",
|
"cumulus-wait-to-announce",
|
||||||
async move {
|
async move {
|
||||||
let t1 = wait_to_announce::<Block>(
|
|
||||||
block_hash,
|
|
||||||
pov_hash,
|
|
||||||
announce_block,
|
|
||||||
signed_stmt_recv,
|
|
||||||
)
|
|
||||||
.fuse();
|
|
||||||
let t2 = rx.fuse();
|
|
||||||
|
|
||||||
pin_mut!(t1, t2);
|
|
||||||
|
|
||||||
tracing::trace!(
|
tracing::trace!(
|
||||||
target: "cumulus-network",
|
target: "cumulus-network",
|
||||||
"waiting for announce block in a background task...",
|
"waiting for announce block in a background task...",
|
||||||
);
|
);
|
||||||
|
|
||||||
select! {
|
wait_to_announce::<Block>(block_hash, pov_hash, announce_block, signed_stmt_recv)
|
||||||
_ = t1 => {
|
.await;
|
||||||
tracing::trace!(
|
|
||||||
target: "cumulus-network",
|
tracing::trace!(
|
||||||
"block announcement finished",
|
target: "cumulus-network",
|
||||||
);
|
"block announcement finished",
|
||||||
},
|
);
|
||||||
_ = t2 => {
|
|
||||||
tracing::trace!(
|
|
||||||
target: "cumulus-network",
|
|
||||||
"previous task that waits for announce block has been canceled",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.boxed(),
|
.boxed(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -127,20 +127,20 @@ fn testnet_genesis(
|
|||||||
id: ParaId,
|
id: ParaId,
|
||||||
) -> parachain_runtime::GenesisConfig {
|
) -> parachain_runtime::GenesisConfig {
|
||||||
parachain_runtime::GenesisConfig {
|
parachain_runtime::GenesisConfig {
|
||||||
frame_system: Some(parachain_runtime::SystemConfig {
|
frame_system: parachain_runtime::SystemConfig {
|
||||||
code: parachain_runtime::WASM_BINARY
|
code: parachain_runtime::WASM_BINARY
|
||||||
.expect("WASM binary was not build, please build it!")
|
.expect("WASM binary was not build, please build it!")
|
||||||
.to_vec(),
|
.to_vec(),
|
||||||
changes_trie_config: Default::default(),
|
changes_trie_config: Default::default(),
|
||||||
}),
|
},
|
||||||
pallet_balances: Some(parachain_runtime::BalancesConfig {
|
pallet_balances: parachain_runtime::BalancesConfig {
|
||||||
balances: endowed_accounts
|
balances: endowed_accounts
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.map(|k| (k, 1 << 60))
|
.map(|k| (k, 1 << 60))
|
||||||
.collect(),
|
.collect(),
|
||||||
}),
|
},
|
||||||
pallet_sudo: Some(parachain_runtime::SudoConfig { key: root_key }),
|
pallet_sudo: parachain_runtime::SudoConfig { key: root_key },
|
||||||
parachain_info: Some(parachain_runtime::ParachainInfoConfig { parachain_id: id }),
|
parachain_info: parachain_runtime::ParachainInfoConfig { parachain_id: id },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,19 +105,19 @@ fn testnet_genesis(
|
|||||||
endowed_accounts: Vec<AccountId>,
|
endowed_accounts: Vec<AccountId>,
|
||||||
) -> cumulus_test_runtime::GenesisConfig {
|
) -> cumulus_test_runtime::GenesisConfig {
|
||||||
cumulus_test_runtime::GenesisConfig {
|
cumulus_test_runtime::GenesisConfig {
|
||||||
frame_system: Some(cumulus_test_runtime::SystemConfig {
|
frame_system: cumulus_test_runtime::SystemConfig {
|
||||||
code: cumulus_test_runtime::WASM_BINARY
|
code: cumulus_test_runtime::WASM_BINARY
|
||||||
.expect("WASM binary was not build, please build it!")
|
.expect("WASM binary was not build, please build it!")
|
||||||
.to_vec(),
|
.to_vec(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}),
|
},
|
||||||
pallet_balances: Some(cumulus_test_runtime::BalancesConfig {
|
pallet_balances: cumulus_test_runtime::BalancesConfig {
|
||||||
balances: endowed_accounts
|
balances: endowed_accounts
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.map(|k| (k, 1 << 60))
|
.map(|k| (k, 1 << 60))
|
||||||
.collect(),
|
.collect(),
|
||||||
}),
|
},
|
||||||
pallet_sudo: Some(cumulus_test_runtime::SudoConfig { key: root_key }),
|
pallet_sudo: cumulus_test_runtime::SudoConfig { key: root_key },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user