Files
pezkuwi-subxt/polkadot/utils/staking-miner/src/prelude.rs
T
Niklas Adolfsson 4210d014ec staking miner: reuse ws conn for remote-ext (#4849)
* staking miner: use config for emergency solution

Fixes #4678

* bump jsonrpsee

* run `monitor_cmd_for` until the connection is closed

* new tokio task for submit_and_watch xt

* re-use header subscription

* update jsonrpsee + simplify code

* revert polkadot runtime changes

* fix grumbles

* Update utils/staking-miner/src/monitor.rs

* staking miner: reuse ws conn for remote-ext

* Revert "revert polkadot runtime changes"

This reverts commit 5fddbbec40702c122b079526915cabac8facdbc1.

* cargo fmt

* revert unintentional change

* revert unintentional change

* add type SharedRpcClient

* cargo fmt

* fix nits

* spelling

* use tracing_subcriber and cleanup

* remove some needless clones

* fix some nits

* fix spellcheck
2022-02-18 11:41:56 +00:00

54 lines
2.1 KiB
Rust

// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Types that we don't fetch from a particular runtime and just assume that they are constant all
//! of the place.
//!
//! It is actually easy to convert the rest as well, but it'll be a lot of noise in our codebase,
//! needing to sprinkle `any_runtime` in a few extra places.
/// The account id type.
pub type AccountId = core_primitives::AccountId;
/// The block number type.
pub type BlockNumber = core_primitives::BlockNumber;
/// The balance type.
pub type Balance = core_primitives::Balance;
/// The index of an account.
pub type Index = core_primitives::AccountIndex;
/// The hash type. We re-export it here, but we can easily get it from block as well.
pub type Hash = core_primitives::Hash;
/// The header type. We re-export it here, but we can easily get it from block as well.
pub type Header = core_primitives::Header;
pub use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
/// Default URI to connect to.
pub const DEFAULT_URI: &str = "wss://rpc.polkadot.io:443";
/// The logging target.
pub const LOG_TARGET: &str = "staking-miner";
/// The election provider pallet.
pub use pallet_election_provider_multi_phase as EPM;
/// The externalities type.
pub type Ext = sp_io::TestExternalities;
/// The key pair type being used. We "strongly" assume sr25519 for simplicity.
pub type Pair = sp_core::sr25519::Pair;
/// A dynamic token type used to represent account balances.
pub type Token = sub_tokens::dynamic::DynamicToken;