Skip to content
Snippets Groups Projects
Commit 9d95121e authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

WIP start fixing conflicts

parent b8960000
No related branches found
No related tags found
No related merge requests found
...@@ -17,12 +17,10 @@ ...@@ -17,12 +17,10 @@
use crate::{ use crate::{
runtime, runtime,
runtime::runtime_types::{ runtime::runtime_types::{
pallet_distance::median::MedianAcc, pallet_distance::median::MedianAcc, sp_arithmetic::per_things::Perbill,
sp_arithmetic::per_things::Perbill,
sp_core::bounded::{bounded_btree_set::BoundedBTreeSet, bounded_vec::BoundedVec},
}, },
}; };
use sp_core::bounded::{bounded_btree_set::BoundedBTreeSet, bounded_vec::BoundedVec};
use sp_core::H256; use sp_core::H256;
use subxt::storage::StorageKey; use subxt::storage::StorageKey;
...@@ -30,8 +28,8 @@ pub type Client = subxt::OnlineClient<crate::RuntimeConfig>; ...@@ -30,8 +28,8 @@ pub type Client = subxt::OnlineClient<crate::RuntimeConfig>;
pub type AccountId = subxt::ext::sp_runtime::AccountId32; pub type AccountId = subxt::ext::sp_runtime::AccountId32;
pub type IdtyIndex = u32; pub type IdtyIndex = u32;
pub type EvaluationPool<AccountId, IdtyIndex> = ( pub type EvaluationPool<AccountId, IdtyIndex> = (
BoundedVec<(IdtyIndex, MedianAcc<Perbill>)>, BoundedVec<(IdtyIndex, MedianAcc<Perbill>), u32>, // FIXME is u32 still the good type?
BoundedBTreeSet<AccountId>, BoundedBTreeSet<AccountId, u32>, // FIXME idem
); );
pub async fn client(rpc_url: String) -> Client { pub async fn client(rpc_url: String) -> Client {
...@@ -111,10 +109,8 @@ pub struct MemberIter( ...@@ -111,10 +109,8 @@ pub struct MemberIter(
subxt::storage::KeyIter< subxt::storage::KeyIter<
crate::RuntimeConfig, crate::RuntimeConfig,
Client, Client,
subxt::metadata::DecodeStaticType<
runtime::runtime_types::sp_membership::MembershipData<u32>, runtime::runtime_types::sp_membership::MembershipData<u32>,
>, >,
>,
); );
impl MemberIter { impl MemberIter {
...@@ -141,13 +137,7 @@ pub async fn cert_iter(client: &Client, evaluation_block: H256) -> CertIter { ...@@ -141,13 +137,7 @@ pub async fn cert_iter(client: &Client, evaluation_block: H256) -> CertIter {
) )
} }
pub struct CertIter( pub struct CertIter(subxt::storage::KeyIter<crate::RuntimeConfig, Client, Vec<(IdtyIndex, u32)>>);
subxt::storage::KeyIter<
crate::RuntimeConfig,
Client,
subxt::metadata::DecodeStaticType<Vec<(IdtyIndex, u32)>>,
>,
);
impl CertIter { impl CertIter {
pub async fn next( pub async fn next(
......
...@@ -41,17 +41,15 @@ pub mod runtime {} ...@@ -41,17 +41,15 @@ pub mod runtime {}
pub enum RuntimeConfig {} pub enum RuntimeConfig {}
impl subxt::config::Config for RuntimeConfig { impl subxt::config::Config for RuntimeConfig {
type Index = u32; type Index = u32;
type BlockNumber = u32; // type BlockNumber = u32;
type Hash = sp_core::H256; type Hash = sp_core::H256;
type Hashing = subxt::ext::sp_runtime::traits::BlakeTwo256; type Hasher = subxt::config::substrate::BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
type Address = subxt::ext::sp_runtime::MultiAddress<Self::AccountId, u32>; type Address = subxt::ext::sp_runtime::MultiAddress<Self::AccountId, u32>;
type Header = subxt::ext::sp_runtime::generic::Header< type Header =
Self::BlockNumber, subxt::config::substrate::SubstrateHeader<u32, subxt::config::substrate::BlakeTwo256>;
subxt::ext::sp_runtime::traits::BlakeTwo256,
>;
type Signature = subxt::ext::sp_runtime::MultiSignature; type Signature = subxt::ext::sp_runtime::MultiSignature;
type ExtrinsicParams = subxt::tx::BaseExtrinsicParams<Self, Tip>; type ExtrinsicParams = subxt::config::extrinsic_params::BaseExtrinsicParams<Self, Tip>;
} }
#[derive(Copy, Clone, Debug, Default, Encode)] #[derive(Copy, Clone, Debug, Default, Encode)]
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment