Remove subxt (#460)

* Remove subxt

Removes ~20 crates from our Cargo.lock.

Removes downloading the metadata and enables removing the getMetadata RPC route
(relevant to #379).

Moves forward #337.

Done now due to distinctions in the subxt 0.32 API surface which make it
justifiable to not update.

* fmt, update due to deny triggering on a yanked crate

* Correct the handling of substrate_block_notifier now that it's ephemeral, not long-lived

* Correct URL in tests/coordinator from ws to http
This commit is contained in:
Luke Parker
2023-11-28 02:29:50 -05:00
committed by GitHub
parent 571195bfda
commit 695d1f0ecf
30 changed files with 473 additions and 718 deletions

View File

@@ -132,13 +132,13 @@ pub fn full_stack(name: &str) -> (Handles, Vec<TestBodySpecification>) {
impl Handles {
pub async fn serai(&self, ops: &DockerOperations) -> Serai {
let serai_rpc = ops.handle(&self.serai).host_port(9944).unwrap();
let serai_rpc = format!("ws://{}:{}", serai_rpc.0, serai_rpc.1);
let serai_rpc = format!("http://{}:{}", serai_rpc.0, serai_rpc.1);
// If the RPC server has yet to start, sleep for up to 60s until it does
for _ in 0 .. 60 {
tokio::time::sleep(Duration::from_secs(1)).await;
let Ok(client) = Serai::new(&serai_rpc).await else { continue };
if client.latest_block_hash().await.is_err() {
let Ok(client) = Serai::new(serai_rpc.clone()).await else { continue };
if client.latest_finalized_block_hash().await.is_err() {
continue;
}
return client;

View File

@@ -201,7 +201,7 @@ async fn mint_and_burn_test() {
let print_at = halt_at / 2;
for i in 0 .. halt_at {
if let Some(key_pair) = serai
.with_current_latest_block()
.as_of_latest_finalized_block()
.await
.unwrap()
.validator_sets()
@@ -417,7 +417,7 @@ async fn mint_and_burn_test() {
let print_at = halt_at / 2;
for i in 0 .. halt_at {
if serai
.with_current_latest_block()
.as_of_latest_finalized_block()
.await
.unwrap()
.in_instructions()