mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 07:55:42 +00:00
* companion for #12212 * cargo fmt * fix build * update Cargo.lock * update Cargo.lock
This commit is contained in:
Generated
+195
-182
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -22,7 +22,7 @@ assert_cmd = "2.0.4"
|
|||||||
nix = "0.24.1"
|
nix = "0.24.1"
|
||||||
tempfile = "3.2.0"
|
tempfile = "3.2.0"
|
||||||
tokio = "1.19.2"
|
tokio = "1.19.2"
|
||||||
remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
substrate-rpc-client = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
polkadot-core-primitives = { path = "core-primitives" }
|
polkadot-core-primitives = { path = "core-primitives" }
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|||||||
@@ -14,14 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use polkadot_core_primitives::Block;
|
use polkadot_core_primitives::{Block, Hash, Header};
|
||||||
use remote_externalities::rpc_api::RpcService;
|
|
||||||
use std::{
|
use std::{
|
||||||
io::{BufRead, BufReader, Read},
|
io::{BufRead, BufReader, Read},
|
||||||
process::{Child, ExitStatus},
|
process::{Child, ExitStatus},
|
||||||
thread,
|
thread,
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
use substrate_rpc_client::{ws_client, ChainApi};
|
||||||
use tokio::time::timeout;
|
use tokio::time::timeout;
|
||||||
|
|
||||||
/// Wait for the given `child` the given amount of `secs`.
|
/// Wait for the given `child` the given amount of `secs`.
|
||||||
@@ -56,12 +56,12 @@ async fn wait_n_finalized_blocks_from(n: usize, url: &str) {
|
|||||||
let mut interval = tokio::time::interval(Duration::from_secs(6));
|
let mut interval = tokio::time::interval(Duration::from_secs(6));
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let rpc_service = match RpcService::new(url, false).await {
|
let rpc = match ws_client(url).await {
|
||||||
Ok(rpc_service) => rpc_service,
|
Ok(rpc_service) => rpc_service,
|
||||||
Err(_) => continue,
|
Err(_) => continue,
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Ok(block) = rpc_service.get_finalized_head::<Block>().await {
|
if let Ok(block) = ChainApi::<(), Hash, Header, Block>::finalized_head(&rpc).await {
|
||||||
built_blocks.insert(block);
|
built_blocks.insert(block);
|
||||||
if built_blocks.len() > n {
|
if built_blocks.len() > n {
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -295,11 +295,16 @@ frame_support::parameter_types! {
|
|||||||
|
|
||||||
/// Build the Ext at hash with all the data of `ElectionProviderMultiPhase` and any additional
|
/// Build the Ext at hash with all the data of `ElectionProviderMultiPhase` and any additional
|
||||||
/// pallets.
|
/// pallets.
|
||||||
async fn create_election_ext<T: EPM::Config, B: BlockT + DeserializeOwned>(
|
async fn create_election_ext<T, B>(
|
||||||
client: SharedRpcClient,
|
client: SharedRpcClient,
|
||||||
at: Option<B::Hash>,
|
at: Option<B::Hash>,
|
||||||
additional: Vec<String>,
|
additional: Vec<String>,
|
||||||
) -> Result<Ext, Error<T>> {
|
) -> Result<Ext, Error<T>>
|
||||||
|
where
|
||||||
|
T: EPM::Config,
|
||||||
|
B: BlockT,
|
||||||
|
B::Header: DeserializeOwned,
|
||||||
|
{
|
||||||
use frame_support::{storage::generator::StorageMap, traits::PalletInfo};
|
use frame_support::{storage::generator::StorageMap, traits::PalletInfo};
|
||||||
use sp_core::hashing::twox_128;
|
use sp_core::hashing::twox_128;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user