From 85bab65bc56482aebfa4978591b886c20d6b4330 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 31 Oct 2022 16:24:46 +0000 Subject: [PATCH] Upgrade to scale-info 2.3 and fix errors --- testing/ui-tests/Cargo.toml | 2 +- testing/ui-tests/src/utils/dispatch_error.rs | 20 ++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/testing/ui-tests/Cargo.toml b/testing/ui-tests/Cargo.toml index 9cc7f4bab7..4cdadd5785 100644 --- a/testing/ui-tests/Cargo.toml +++ b/testing/ui-tests/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" [dev-dependencies] trybuild = "1.0.63" -scale-info = { version = "2.0.0", features = ["bit-vec"] } +scale-info = { version = "2.3.0", features = ["bit-vec"] } frame-metadata = "15.0.0" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } subxt = { path = "../../subxt" } diff --git a/testing/ui-tests/src/utils/dispatch_error.rs b/testing/ui-tests/src/utils/dispatch_error.rs index 6884955dc4..7e9cdb6fcd 100644 --- a/testing/ui-tests/src/utils/dispatch_error.rs +++ b/testing/ui-tests/src/utils/dispatch_error.rs @@ -4,9 +4,7 @@ use scale_info::{ build::{ - FieldsBuilder, - NamedFields, - UnnamedFields, + Fields, Variants, }, Path, @@ -30,7 +28,7 @@ impl TypeInfo for NamedFieldDispatchError { .variant(Variants::new().variant("Module", |builder| { builder .fields( - FieldsBuilder::::default() + Fields::named() .field(|b| b.name("error").ty::()) .field(|b| b.name("index").ty::()), ) @@ -53,7 +51,7 @@ impl TypeInfo for LegacyDispatchError { Type::builder() .path(Path::new("ModuleError", "sp_runtime")) .composite( - FieldsBuilder::::default() + Fields::named() .field(|b| b.name("index").ty::()) .field(|b| b.name("error").ty::()), ) @@ -64,10 +62,7 @@ impl TypeInfo for LegacyDispatchError { .path(Path::new("DispatchError", "sp_runtime")) .variant(Variants::new().variant("Module", |builder| { builder - .fields( - FieldsBuilder::::default() - .field(|b| b.ty::()), - ) + .fields(Fields::unnamed().field(|b| b.ty::())) .index(0) })) } @@ -87,7 +82,7 @@ impl TypeInfo for ArrayDispatchError { Type::builder() .path(Path::new("ModuleError", "sp_runtime")) .composite( - FieldsBuilder::::default() + Fields::named() .field(|b| b.name("index").ty::()) .field(|b| b.name("error").ty::<[u8; 4]>()), ) @@ -98,10 +93,7 @@ impl TypeInfo for ArrayDispatchError { .path(Path::new("DispatchError", "sp_runtime")) .variant(Variants::new().variant("Module", |builder| { builder - .fields( - FieldsBuilder::::default() - .field(|b| b.ty::()), - ) + .fields(Fields::unnamed().field(|b| b.ty::())) .index(0) })) }