Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to polkadot v1.8.0 #361

Merged
merged 41 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d73d158
bump to crates.io
brenzi Mar 1, 2024
bea1abc
fixes
brenzi Mar 1, 2024
07a26f9
try to fix simd ahash
brenzi Mar 1, 2024
1bd040e
bump nightly
brenzi Mar 1, 2024
76965c6
same toolchains as sdk. cargo update. no luck
brenzi Mar 1, 2024
7a8b7de
taplo fmt
brenzi Mar 1, 2024
4c554b6
disable toolchain-pin and re-applysdk lockfile
brenzi Mar 1, 2024
6d09425
still no luck with nightly
brenzi Mar 1, 2024
8413e95
WIP before migrating to async api client
brenzi Mar 2, 2024
9f92dd5
node upgrades
brenzi Mar 2, 2024
72d97d3
fix node build
brenzi Mar 2, 2024
60468a0
try async jsonrpsee
brenzi Mar 2, 2024
e4d6a5c
more awaits
brenzi Mar 2, 2024
b86703b
use streams for async filter_map
brenzi Mar 2, 2024
b945e3d
plenty of async fixes. WIP
brenzi Mar 3, 2024
b5ef178
found a solution. WIP
brenzi Mar 3, 2024
46fce4a
finally one first command compiles
brenzi Mar 4, 2024
5e4bda1
fixed cmd_vote
brenzi Mar 5, 2024
48d5270
added more fn
brenzi Mar 5, 2024
3272916
moar fn
brenzi Mar 5, 2024
6a0b677
moar fn
brenzi Mar 5, 2024
72a9698
all commands refactored
brenzi Mar 5, 2024
12a443f
toml cosmetics
brenzi Mar 5, 2024
780bb5c
lift patches
brenzi Mar 5, 2024
af49527
molularize commands
brenzi Mar 5, 2024
56709fe
cargo fix
brenzi Mar 5, 2024
6d005b8
more cleanup of main. distribute helper fn to modules
brenzi Mar 5, 2024
2d52472
cargo fix
brenzi Mar 5, 2024
930a18f
fmt +nightly
brenzi Mar 5, 2024
7f75c6c
cleanup remaining warnings
brenzi Mar 5, 2024
bf16511
CI with nightly fmt
brenzi Mar 5, 2024
f9cc01c
fix CI
brenzi Mar 5, 2024
e631bcb
fmt
brenzi Mar 5, 2024
ebcb7d0
fix extra feature builds
brenzi Mar 5, 2024
bbb627a
fix node impl got genesis
brenzi Mar 5, 2024
133c70f
fix broken faucet whitelist arg
brenzi Mar 6, 2024
f49197a
fix CI test validation for VerifiedLinked(_)
brenzi Mar 6, 2024
7c55d55
fix reputation checks
brenzi Mar 6, 2024
a0b0a08
some toml cosmetics
brenzi Mar 6, 2024
0715528
fix democracy list-proposals
brenzi Mar 6, 2024
3b73bec
fix democracy.vote extrinsic
brenzi Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use streams for async filter_map
brenzi committed Mar 2, 2024
commit b86703b3d8e2c41627058adaf08049054be900b6
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/encointer-api-client-extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ parity-scale-codec = { workspace = true }
serde = { workspace = true, features = ["std"] }
serde_json = { workspace = true }
tokio = { workspace = true }
futures = { workspace = true }

# encointer deps
encointer-ceremonies-assignment = { workspace = true, features = ["std"] }
68 changes: 39 additions & 29 deletions client/encointer-api-client-extension/src/ceremonies.rs
Original file line number Diff line number Diff line change
@@ -9,9 +9,9 @@ use encointer_primitives::{
},
communities::Location,
};
use futures::stream::{self, StreamExt, TryStreamExt};
use log::warn;
use serde::{Deserialize, Serialize};

use sp_runtime::AccountId32 as AccountId;
use substrate_api_client::{api::error::Error as ApiClientError, GetStorage};
pub type Moment = u64;
@@ -296,43 +296,53 @@ impl CeremoniesApi for Api {
let params = self.get_assignments(community_ceremony).await?;
let assigned = self.get_assignment_counts(community_ceremony).await?;

let bootstrappers_reputables = assignment_fn_inverse(
meetup_index_zero_based,
params.bootstrappers_reputables,
meetup_count,
assigned.bootstrappers + assigned.reputables,
let bootstrappers_reputables = stream::iter(
assignment_fn_inverse(
meetup_index_zero_based,
params.bootstrappers_reputables,
meetup_count,
assigned.bootstrappers + assigned.reputables,
)
.unwrap_or_default(),
)
.unwrap_or_default()
.into_iter()
.filter_map(|p_index| {
.filter_map(|p_index| async move {
get_bootstrapper_or_reputable(self, community_ceremony, p_index, &assigned)
.await
.ok()
.flatten()
});

let endorsees = assignment_fn_inverse(
meetup_index_zero_based,
params.endorsees,
meetup_count,
assigned.endorsees,
let endorsees = stream::iter(
assignment_fn_inverse(
meetup_index_zero_based,
params.endorsees,
meetup_count,
assigned.endorsees,
)
.unwrap_or_default()
.into_iter()
.filter(|p| p < &assigned.endorsees),
)
.unwrap_or_default()
.into_iter()
.filter(|p| p < &assigned.endorsees)
.filter_map(|p| self.get_endorsee(community_ceremony, &(p + 1)).ok().flatten());

let newbies = assignment_fn_inverse(
meetup_index_zero_based,
params.newbies,
meetup_count,
assigned.newbies,
.filter_map(|p| async move {
self.get_endorsee(community_ceremony, &(p + 1)).await.ok().flatten()
});

let newbies = stream::iter(
assignment_fn_inverse(
meetup_index_zero_based,
params.newbies,
meetup_count,
assigned.newbies,
)
.unwrap_or_default()
.into_iter()
.filter(|p| p < &assigned.newbies),
)
.unwrap_or_default()
.into_iter()
.filter(|p| p < &assigned.newbies)
.filter_map(|p| self.get_newbie(community_ceremony, &(p + 1)).ok().flatten());
.filter_map(|p| async move {
self.get_newbie(community_ceremony, &(p + 1)).await.ok().flatten()
});

Ok(bootstrappers_reputables.chain(endorsees).chain(newbies).collect())
Ok(bootstrappers_reputables.chain(endorsees).chain(newbies).collect().await)
}

async fn get_meetup_time_offset(&self) -> Result<Option<MeetupTimeOffsetType>> {