mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
frame/utils: introduce substrate-rpc-client crate for RPC utils (#12212)
* hack together a PoC * Update utils/frame/rpc-utils/Cargo.toml Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update utils/frame/rpc-utils/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * rpc_utils -> substrate_rpc_client * try runtime: remove keep connection * make CI happy * cargo fmt * fix ci * update lock file * fix * fix Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: kianenigma <kian@parity.io>
This commit is contained in:
@@ -24,14 +24,15 @@ use sp_runtime::{traits::Block as BlockT, DeserializeOwned};
|
||||
|
||||
/// Test voter bags migration. `currency_unit` is the number of planks per the the runtimes `UNITS`
|
||||
/// (i.e. number of decimal places per DOT, KSM etc)
|
||||
pub async fn execute<
|
||||
Runtime: RuntimeT<pallet_bags_list::Instance1>,
|
||||
Block: BlockT + DeserializeOwned,
|
||||
>(
|
||||
pub async fn execute<Runtime, Block>(
|
||||
currency_unit: u64,
|
||||
currency_name: &'static str,
|
||||
ws_url: String,
|
||||
) {
|
||||
) where
|
||||
Runtime: RuntimeT<pallet_bags_list::Instance1>,
|
||||
Block: BlockT,
|
||||
Block::Header: DeserializeOwned,
|
||||
{
|
||||
let mut ext = Builder::<Block>::new()
|
||||
.mode(Mode::Online(OnlineConfig {
|
||||
transport: ws_url.to_string().into(),
|
||||
|
||||
@@ -22,14 +22,12 @@ use remote_externalities::{Builder, Mode, OnlineConfig};
|
||||
use sp_runtime::{traits::Block as BlockT, DeserializeOwned};
|
||||
|
||||
/// Execute create a snapshot from pallet-staking.
|
||||
pub async fn execute<
|
||||
pub async fn execute<Runtime, Block>(voter_limit: Option<usize>, currency_unit: u64, ws_url: String)
|
||||
where
|
||||
Runtime: crate::RuntimeT<pallet_bags_list::Instance1>,
|
||||
Block: BlockT + DeserializeOwned,
|
||||
>(
|
||||
voter_limit: Option<usize>,
|
||||
currency_unit: u64,
|
||||
ws_url: String,
|
||||
) {
|
||||
Block: BlockT,
|
||||
Block::Header: DeserializeOwned,
|
||||
{
|
||||
use frame_support::storage::generator::StorageMap;
|
||||
|
||||
let mut ext = Builder::<Block>::new()
|
||||
|
||||
@@ -25,14 +25,15 @@ use remote_externalities::{Builder, Mode, OnlineConfig};
|
||||
use sp_runtime::{traits::Block as BlockT, DeserializeOwned};
|
||||
|
||||
/// Execute the sanity check of the bags-list.
|
||||
pub async fn execute<
|
||||
Runtime: crate::RuntimeT<pallet_bags_list::Instance1>,
|
||||
Block: BlockT + DeserializeOwned,
|
||||
>(
|
||||
pub async fn execute<Runtime, Block>(
|
||||
currency_unit: u64,
|
||||
currency_name: &'static str,
|
||||
ws_url: String,
|
||||
) {
|
||||
) where
|
||||
Runtime: crate::RuntimeT<pallet_bags_list::Instance1>,
|
||||
Block: BlockT,
|
||||
Block::Header: DeserializeOwned,
|
||||
{
|
||||
let mut ext = Builder::<Block>::new()
|
||||
.mode(Mode::Online(OnlineConfig {
|
||||
transport: ws_url.to_string().into(),
|
||||
|
||||
Reference in New Issue
Block a user