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 @@
use crate::{
runtime,
runtime::runtime_types::{
pallet_distance::median::MedianAcc,
sp_arithmetic::per_things::Perbill,
sp_core::bounded::{bounded_btree_set::BoundedBTreeSet, bounded_vec::BoundedVec},
pallet_distance::median::MedianAcc, sp_arithmetic::per_things::Perbill,
},
};
use sp_core::bounded::{bounded_btree_set::BoundedBTreeSet, bounded_vec::BoundedVec};
use sp_core::H256;
use subxt::storage::StorageKey;
......@@ -30,8 +28,8 @@ pub type Client = subxt::OnlineClient<crate::RuntimeConfig>;
pub type AccountId = subxt::ext::sp_runtime::AccountId32;
pub type IdtyIndex = u32;
pub type EvaluationPool<AccountId, IdtyIndex> = (
BoundedVec<(IdtyIndex, MedianAcc<Perbill>)>,
BoundedBTreeSet<AccountId>,
BoundedVec<(IdtyIndex, MedianAcc<Perbill>), u32>, // FIXME is u32 still the good type?
BoundedBTreeSet<AccountId, u32>, // FIXME idem
);
pub async fn client(rpc_url: String) -> Client {
......@@ -111,10 +109,8 @@ pub struct MemberIter(
subxt::storage::KeyIter<
crate::RuntimeConfig,
Client,
subxt::metadata::DecodeStaticType<
runtime::runtime_types::sp_membership::MembershipData<u32>,
>,
>,
);
impl MemberIter {
......@@ -141,13 +137,7 @@ pub async fn cert_iter(client: &Client, evaluation_block: H256) -> CertIter {
)
}
pub struct CertIter(
subxt::storage::KeyIter<
crate::RuntimeConfig,
Client,
subxt::metadata::DecodeStaticType<Vec<(IdtyIndex, u32)>>,
>,
);
pub struct CertIter(subxt::storage::KeyIter<crate::RuntimeConfig, Client, Vec<(IdtyIndex, u32)>>);
impl CertIter {
pub async fn next(
......
......@@ -41,17 +41,15 @@ pub mod runtime {}
pub enum RuntimeConfig {}
impl subxt::config::Config for RuntimeConfig {
type Index = u32;
type BlockNumber = u32;
// type BlockNumber = u32;
type Hash = sp_core::H256;
type Hashing = subxt::ext::sp_runtime::traits::BlakeTwo256;
type Hasher = subxt::config::substrate::BlakeTwo256;
type AccountId = AccountId;
type Address = subxt::ext::sp_runtime::MultiAddress<Self::AccountId, u32>;
type Header = subxt::ext::sp_runtime::generic::Header<
Self::BlockNumber,
subxt::ext::sp_runtime::traits::BlakeTwo256,
>;
type Header =
subxt::config::substrate::SubstrateHeader<u32, subxt::config::substrate::BlakeTwo256>;
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)]
......
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