From e5e7e529f32ccdf24dc8ce4f5dbdc343fde950ba Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 30 Mar 2023 14:41:51 +0100 Subject: [PATCH 1/3] Upgrade `scale-info` to `2.5` (#1733) * Update requirements to scale-info 2.5 * Use fields to fix deprecation warnings * Your mother * Fmt --- crates/e2e/Cargo.toml | 2 +- crates/env/Cargo.toml | 2 +- crates/ink/Cargo.toml | 2 +- crates/ink/macro/Cargo.toml | 2 +- crates/ink/tests/return_type_metadata.rs | 33 +++++++++---------- crates/metadata/Cargo.toml | 2 +- crates/primitives/Cargo.toml | 2 +- crates/storage/Cargo.toml | 2 +- crates/storage/traits/Cargo.toml | 2 +- .../basic_contract_caller/Cargo.toml | 2 +- .../other_contract/Cargo.toml | 2 +- integration-tests/call-runtime/Cargo.toml | 2 +- .../conditional-compilation/Cargo.toml | 2 +- .../contract-terminate/Cargo.toml | 2 +- .../contract-transfer/Cargo.toml | 2 +- .../custom-environment/Cargo.toml | 2 +- integration-tests/custom_allocator/Cargo.toml | 2 +- integration-tests/dns/Cargo.toml | 2 +- integration-tests/erc1155/Cargo.toml | 2 +- integration-tests/erc20/Cargo.toml | 2 +- integration-tests/erc721/Cargo.toml | 2 +- integration-tests/flipper/Cargo.toml | 2 +- integration-tests/incrementer/Cargo.toml | 2 +- .../call-builder/Cargo.toml | 2 +- .../constructors-return-value/Cargo.toml | 2 +- .../integration-flipper/Cargo.toml | 2 +- .../mapping_integration_tests/Cargo.toml | 2 +- .../multi_contract_caller/Cargo.toml | 2 +- .../accumulator/Cargo.toml | 2 +- .../multi_contract_caller/adder/Cargo.toml | 2 +- .../multi_contract_caller/subber/Cargo.toml | 2 +- integration-tests/multisig/Cargo.toml | 2 +- integration-tests/payment-channel/Cargo.toml | 2 +- integration-tests/psp22-extension/Cargo.toml | 2 +- integration-tests/rand-extension/Cargo.toml | 2 +- integration-tests/set_code_hash/Cargo.toml | 2 +- .../updated_incrementer/Cargo.toml | 2 +- .../trait-dyn-cross-contract-calls/Cargo.toml | 2 +- .../contracts/incrementer/Cargo.toml | 2 +- .../traits/Cargo.toml | 2 +- integration-tests/trait-erc20/Cargo.toml | 2 +- integration-tests/trait-flipper/Cargo.toml | 2 +- .../trait-incrementer/Cargo.toml | 2 +- .../trait-incrementer/traits/Cargo.toml | 2 +- linting/Cargo.toml | 2 +- 45 files changed, 60 insertions(+), 61 deletions(-) diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index c40a8ba382b..18f42631d70 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -40,7 +40,7 @@ sp-weights = "14.0.0" [dev-dependencies] # Required for the doctest of `MessageBuilder::call` -scale-info = { version = "2.3", default-features = false, features = ["derive"] } +scale-info = { version = "2.5", default-features = false, features = ["derive"] } [features] default = ["std"] diff --git a/crates/env/Cargo.toml b/crates/env/Cargo.toml index 504758ee928..7157be4b9e6 100644 --- a/crates/env/Cargo.toml +++ b/crates/env/Cargo.toml @@ -48,7 +48,7 @@ secp256k1 = { version = "0.27.0", features = ["recovery", "global-context"], opt # # Sadly couldn't be marked as dev-dependency. # Never use this crate outside the off-chain environment! -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink = { path = "../ink" } diff --git a/crates/ink/Cargo.toml b/crates/ink/Cargo.toml index 08742746d1e..1dd74ad93c3 100644 --- a/crates/ink/Cargo.toml +++ b/crates/ink/Cargo.toml @@ -32,7 +32,7 @@ ink_metadata = { path = "../metadata", default-features = false } trybuild = { version = "1.0.60", features = ["diff"] } # Required for the doctest of `env_access::EnvAccess::instantiate_contract` -scale-info = { version = "2.3", default-features = false, features = ["derive"] } +scale-info = { version = "2.5", default-features = false, features = ["derive"] } [features] default = ["std"] diff --git a/crates/ink/macro/Cargo.toml b/crates/ink/macro/Cargo.toml index 957853742d8..e5146f97eb5 100644 --- a/crates/ink/macro/Cargo.toml +++ b/crates/ink/macro/Cargo.toml @@ -31,7 +31,7 @@ ink = { path = ".." } ink_metadata = { path = "../../metadata" } ink_prelude = { path = "../../prelude" } ink_storage = { path = "../../storage" } -scale-info = { version = "2.3", default-features = false, features = ["derive"] } +scale-info = { version = "2.5", default-features = false, features = ["derive"] } [lib] name = "ink_macro" diff --git a/crates/ink/tests/return_type_metadata.rs b/crates/ink/tests/return_type_metadata.rs index cd956899f72..d7f41a9bb93 100644 --- a/crates/ink/tests/return_type_metadata.rs +++ b/crates/ink/tests/return_type_metadata.rs @@ -66,21 +66,21 @@ mod tests { ) -> (&'a Type, &'a Type) { assert_eq!( "Result", - format!("{}", ty.path()), + format!("{}", ty.path), "Message return type should be a Result" ); - match ty.type_def() { + match &ty.type_def { TypeDef::Variant(variant) => { - assert_eq!(2, variant.variants().len()); - let ok_variant = &variant.variants()[0]; - let ok_field = &ok_variant.fields()[0]; - let ok_ty = resolve_type(metadata, ok_field.ty().id()); - assert_eq!("Ok", ok_variant.name()); + assert_eq!(2, variant.variants.len()); + let ok_variant = &variant.variants[0]; + let ok_field = &ok_variant.fields[0]; + let ok_ty = resolve_type(metadata, ok_field.ty.id); + assert_eq!("Ok", ok_variant.name); - let err_variant = &variant.variants()[1]; - let err_field = &err_variant.fields()[0]; - let err_ty = resolve_type(metadata, err_field.ty().id()); - assert_eq!("Err", err_variant.name()); + let err_variant = &variant.variants[1]; + let err_field = &err_variant.fields[0]; + let err_ty = resolve_type(metadata, err_field.ty.id); + assert_eq!("Err", err_variant.name); (ok_ty, err_ty) } @@ -107,10 +107,10 @@ mod tests { assert_eq!("TraitDefinition::get_value", message.label()); let type_spec = message.return_type().opt_type().unwrap(); - let ty = resolve_type(&metadata, type_spec.ty().id()); + let ty = resolve_type(&metadata, type_spec.ty().id); let (ok_ty, _) = extract_result(&metadata, ty); - assert_eq!(&TypeDef::Primitive(TypeDefPrimitive::U32), ok_ty.type_def()); + assert_eq!(TypeDef::Primitive(TypeDefPrimitive::U32), ok_ty.type_def); } #[test] @@ -125,19 +125,18 @@ mod tests { format!("{}", type_spec.display_name()) ); - let outer_result_ty = resolve_type(&metadata, type_spec.ty().id()); + let outer_result_ty = resolve_type(&metadata, type_spec.ty().id); let (outer_ok_ty, outer_err_ty) = extract_result(&metadata, outer_result_ty); let (inner_ok_ty, _) = extract_result(&metadata, outer_ok_ty); assert_eq!( - format!("{}", outer_err_ty.path()), + format!("{}", outer_err_ty.path), "ink_primitives::LangError" ); let unit_ty = TypeDef::Tuple(TypeDefTuple::new_portable(vec![])); assert_eq!( - &unit_ty, - inner_ok_ty.type_def(), + unit_ty, inner_ok_ty.type_def, "Ok variant should be a unit `()` type" ); } diff --git a/crates/metadata/Cargo.toml b/crates/metadata/Cargo.toml index ec81cc398d9..ce9f27cd6e2 100644 --- a/crates/metadata/Cargo.toml +++ b/crates/metadata/Cargo.toml @@ -21,7 +21,7 @@ ink_primitives = { version = "4.1.0", path = "../primitives/", default-features serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } impl-serde = "0.4.0" derive_more = { version = "0.99", default-features = false, features = ["from"] } -scale-info = { version = "2.3", default-features = false, features = ["derive", "serde", "decode"] } +scale-info = { version = "2.5", default-features = false, features = ["derive", "serde", "decode"] } [dev-dependencies] pretty_assertions = "1" diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 86f852a49e7..b004b5e3788 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -18,7 +18,7 @@ include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"] derive_more = { version = "0.99", default-features = false, features = ["from", "display"] } ink_prelude = { version = "4.1.0", path = "../prelude/", default-features = false } scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } xxhash-rust = { version = "0.8", features = ["const_xxh32"] } [features] diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml index ccbe4dabe2b..af9809a87ff 100644 --- a/crates/storage/Cargo.toml +++ b/crates/storage/Cargo.toml @@ -23,7 +23,7 @@ ink_prelude = { version = "4.1.0", path = "../prelude/", default-features = fals scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } derive_more = { version = "0.99", default-features = false, features = ["from", "display"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } cfg-if = "1.0" array-init = { version = "2.0", default-features = false } diff --git a/crates/storage/traits/Cargo.toml b/crates/storage/traits/Cargo.toml index f09c8a7db0c..99199608437 100644 --- a/crates/storage/traits/Cargo.toml +++ b/crates/storage/traits/Cargo.toml @@ -19,7 +19,7 @@ ink_metadata = { version = "4.1.0", path = "../../metadata", default-features = ink_primitives = { version = "4.1.0", path = "../../primitives", default-features = false } ink_prelude = { version = "4.1.0", path = "../../prelude", default-features = false } scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] paste = "1.0" diff --git a/integration-tests/basic_contract_caller/Cargo.toml b/integration-tests/basic_contract_caller/Cargo.toml index b51296a1a2a..ed758b63844 100755 --- a/integration-tests/basic_contract_caller/Cargo.toml +++ b/integration-tests/basic_contract_caller/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } # Note: We **need** to specify the `ink-as-dependency` feature. # diff --git a/integration-tests/basic_contract_caller/other_contract/Cargo.toml b/integration-tests/basic_contract_caller/other_contract/Cargo.toml index 05ffc8c7860..6bb3f3e3089 100755 --- a/integration-tests/basic_contract_caller/other_contract/Cargo.toml +++ b/integration-tests/basic_contract_caller/other_contract/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../../crates/e2e" } diff --git a/integration-tests/call-runtime/Cargo.toml b/integration-tests/call-runtime/Cargo.toml index 72aa67835a9..84538775554 100644 --- a/integration-tests/call-runtime/Cargo.toml +++ b/integration-tests/call-runtime/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false, features = ["call-runtime"] } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } # Substrate # diff --git a/integration-tests/conditional-compilation/Cargo.toml b/integration-tests/conditional-compilation/Cargo.toml index 121375b9a46..ca4a0f77e20 100755 --- a/integration-tests/conditional-compilation/Cargo.toml +++ b/integration-tests/conditional-compilation/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/contract-terminate/Cargo.toml b/integration-tests/contract-terminate/Cargo.toml index 4b86542b62b..31238bf1473 100644 --- a/integration-tests/contract-terminate/Cargo.toml +++ b/integration-tests/contract-terminate/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/contract-transfer/Cargo.toml b/integration-tests/contract-transfer/Cargo.toml index d1ef6b38380..f6f5403ab61 100644 --- a/integration-tests/contract-transfer/Cargo.toml +++ b/integration-tests/contract-transfer/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/custom-environment/Cargo.toml b/integration-tests/custom-environment/Cargo.toml index c227f9e42f4..f05547dfe9b 100644 --- a/integration-tests/custom-environment/Cargo.toml +++ b/integration-tests/custom-environment/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/custom_allocator/Cargo.toml b/integration-tests/custom_allocator/Cargo.toml index 958b0642599..2d7f50453c9 100755 --- a/integration-tests/custom_allocator/Cargo.toml +++ b/integration-tests/custom_allocator/Cargo.toml @@ -14,7 +14,7 @@ ink = { path = "../../crates/ink", default-features = false, features = ["no-all dlmalloc = {version = "0.2", default-features = false, features = ["global"] } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/dns/Cargo.toml b/integration-tests/dns/Cargo.toml index 30d9de47bc0..bb86e8a155d 100644 --- a/integration-tests/dns/Cargo.toml +++ b/integration-tests/dns/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/erc1155/Cargo.toml b/integration-tests/erc1155/Cargo.toml index 9bfffca136c..1901d76aecb 100644 --- a/integration-tests/erc1155/Cargo.toml +++ b/integration-tests/erc1155/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/erc20/Cargo.toml b/integration-tests/erc20/Cargo.toml index 1b7bbdc1f47..85ba2d1c664 100644 --- a/integration-tests/erc20/Cargo.toml +++ b/integration-tests/erc20/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/erc721/Cargo.toml b/integration-tests/erc721/Cargo.toml index 396cb40c23f..3140985e945 100644 --- a/integration-tests/erc721/Cargo.toml +++ b/integration-tests/erc721/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/flipper/Cargo.toml b/integration-tests/flipper/Cargo.toml index 926bb25a061..028546ed4e9 100644 --- a/integration-tests/flipper/Cargo.toml +++ b/integration-tests/flipper/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/incrementer/Cargo.toml b/integration-tests/incrementer/Cargo.toml index 4d8a246e14d..dafef93c08c 100644 --- a/integration-tests/incrementer/Cargo.toml +++ b/integration-tests/incrementer/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/lang-err-integration-tests/call-builder/Cargo.toml b/integration-tests/lang-err-integration-tests/call-builder/Cargo.toml index acb38dd323c..bc1373e3391 100755 --- a/integration-tests/lang-err-integration-tests/call-builder/Cargo.toml +++ b/integration-tests/lang-err-integration-tests/call-builder/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } constructors_return_value = { path = "../constructors-return-value", default-features = false, features = ["ink-as-dependency"] } integration_flipper = { path = "../integration-flipper", default-features = false, features = ["ink-as-dependency"] } diff --git a/integration-tests/lang-err-integration-tests/constructors-return-value/Cargo.toml b/integration-tests/lang-err-integration-tests/constructors-return-value/Cargo.toml index 4213d171654..b2151fd70a7 100644 --- a/integration-tests/lang-err-integration-tests/constructors-return-value/Cargo.toml +++ b/integration-tests/lang-err-integration-tests/constructors-return-value/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../../crates/e2e" } diff --git a/integration-tests/lang-err-integration-tests/integration-flipper/Cargo.toml b/integration-tests/lang-err-integration-tests/integration-flipper/Cargo.toml index 5e00edae9c4..d54e93e1a51 100644 --- a/integration-tests/lang-err-integration-tests/integration-flipper/Cargo.toml +++ b/integration-tests/lang-err-integration-tests/integration-flipper/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../../crates/e2e" } diff --git a/integration-tests/mapping_integration_tests/Cargo.toml b/integration-tests/mapping_integration_tests/Cargo.toml index 5f29d461860..2f7bf28621e 100755 --- a/integration-tests/mapping_integration_tests/Cargo.toml +++ b/integration-tests/mapping_integration_tests/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/multi_contract_caller/Cargo.toml b/integration-tests/multi_contract_caller/Cargo.toml index a06c4f60cab..a80507b60cf 100644 --- a/integration-tests/multi_contract_caller/Cargo.toml +++ b/integration-tests/multi_contract_caller/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } adder = { path = "adder", default-features = false, features = ["ink-as-dependency"] } subber = { path = "subber", default-features = false, features = ["ink-as-dependency"] } diff --git a/integration-tests/multi_contract_caller/accumulator/Cargo.toml b/integration-tests/multi_contract_caller/accumulator/Cargo.toml index 85c50df5d10..87171ee7400 100644 --- a/integration-tests/multi_contract_caller/accumulator/Cargo.toml +++ b/integration-tests/multi_contract_caller/accumulator/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/multi_contract_caller/adder/Cargo.toml b/integration-tests/multi_contract_caller/adder/Cargo.toml index d7c09f4f72d..5d7fc33cd88 100644 --- a/integration-tests/multi_contract_caller/adder/Cargo.toml +++ b/integration-tests/multi_contract_caller/adder/Cargo.toml @@ -10,7 +10,7 @@ ink = { path = "../../../crates/ink", default-features = false } accumulator = { path = "../accumulator", default-features = false, features = ["ink-as-dependency"] } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/multi_contract_caller/subber/Cargo.toml b/integration-tests/multi_contract_caller/subber/Cargo.toml index d6ddbd30b55..2f0319c9893 100644 --- a/integration-tests/multi_contract_caller/subber/Cargo.toml +++ b/integration-tests/multi_contract_caller/subber/Cargo.toml @@ -10,7 +10,7 @@ ink = { path = "../../../crates/ink", default-features = false } accumulator = { path = "../accumulator", default-features = false, features = ["ink-as-dependency"] } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/multisig/Cargo.toml b/integration-tests/multisig/Cargo.toml index ed51e523e94..c79fb84293b 100755 --- a/integration-tests/multisig/Cargo.toml +++ b/integration-tests/multisig/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/payment-channel/Cargo.toml b/integration-tests/payment-channel/Cargo.toml index 01701f12d6b..79d5a760f9a 100755 --- a/integration-tests/payment-channel/Cargo.toml +++ b/integration-tests/payment-channel/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"] } +scale-info = { version = "2.5", default-features = false, features = ["derive"] } [dev-dependencies] hex-literal = { version = "0.3" } diff --git a/integration-tests/psp22-extension/Cargo.toml b/integration-tests/psp22-extension/Cargo.toml index 7a6394d7ad2..12964d1aa88 100755 --- a/integration-tests/psp22-extension/Cargo.toml +++ b/integration-tests/psp22-extension/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/rand-extension/Cargo.toml b/integration-tests/rand-extension/Cargo.toml index e4738d9bba4..dea3f279c91 100755 --- a/integration-tests/rand-extension/Cargo.toml +++ b/integration-tests/rand-extension/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/set_code_hash/Cargo.toml b/integration-tests/set_code_hash/Cargo.toml index 01cc383d557..ad7348a92be 100644 --- a/integration-tests/set_code_hash/Cargo.toml +++ b/integration-tests/set_code_hash/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/set_code_hash/updated_incrementer/Cargo.toml b/integration-tests/set_code_hash/updated_incrementer/Cargo.toml index c5e65e6893d..f7581edb4fe 100644 --- a/integration-tests/set_code_hash/updated_incrementer/Cargo.toml +++ b/integration-tests/set_code_hash/updated_incrementer/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/trait-dyn-cross-contract-calls/Cargo.toml b/integration-tests/trait-dyn-cross-contract-calls/Cargo.toml index 3069b485467..8d98b2cd65a 100644 --- a/integration-tests/trait-dyn-cross-contract-calls/Cargo.toml +++ b/integration-tests/trait-dyn-cross-contract-calls/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } dyn-traits = { path = "./traits", default-features = false } diff --git a/integration-tests/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml b/integration-tests/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml index 0edecf89580..0cf71da988f 100644 --- a/integration-tests/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml +++ b/integration-tests/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } dyn-traits = { path = "../../traits", default-features = false } diff --git a/integration-tests/trait-dyn-cross-contract-calls/traits/Cargo.toml b/integration-tests/trait-dyn-cross-contract-calls/traits/Cargo.toml index 10f172681a1..6908901455b 100644 --- a/integration-tests/trait-dyn-cross-contract-calls/traits/Cargo.toml +++ b/integration-tests/trait-dyn-cross-contract-calls/traits/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/trait-erc20/Cargo.toml b/integration-tests/trait-erc20/Cargo.toml index 76146dcefba..5b950a06fa2 100644 --- a/integration-tests/trait-erc20/Cargo.toml +++ b/integration-tests/trait-erc20/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/trait-flipper/Cargo.toml b/integration-tests/trait-flipper/Cargo.toml index 73dbd6bf368..357f76754e5 100644 --- a/integration-tests/trait-flipper/Cargo.toml +++ b/integration-tests/trait-flipper/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] path = "lib.rs" diff --git a/integration-tests/trait-incrementer/Cargo.toml b/integration-tests/trait-incrementer/Cargo.toml index bc9761fcda5..c3a1d209050 100644 --- a/integration-tests/trait-incrementer/Cargo.toml +++ b/integration-tests/trait-incrementer/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } traits = { path = "./traits", default-features = false } [lib] diff --git a/integration-tests/trait-incrementer/traits/Cargo.toml b/integration-tests/trait-incrementer/traits/Cargo.toml index bbac5ffa143..b9b09761d9a 100644 --- a/integration-tests/trait-incrementer/traits/Cargo.toml +++ b/integration-tests/trait-incrementer/traits/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [lib] name = "traits" diff --git a/linting/Cargo.toml b/linting/Cargo.toml index c9de2a2080d..37675fca597 100644 --- a/linting/Cargo.toml +++ b/linting/Cargo.toml @@ -34,7 +34,7 @@ ink_metadata = { path = "../crates/metadata", default-features = false } ink_primitives = { path = "../crates/primitives", default-features = false } ink_storage = { path = "../crates/storage", default-features = false } scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"] } +scale-info = { version = "2.5", default-features = false, features = ["derive"] } # For the moment we have to include the tests as examples and # then use `dylint_testing::ui_test_examples`. From f6bf8f716f6c3316fb6d97f7c45fdcada514d2a0 Mon Sep 17 00:00:00 2001 From: Sam Ruberti Date: Tue, 4 Apr 2023 10:41:46 -0400 Subject: [PATCH 2/3] Fix broken links (#1732) * Fix broken links * Fix broken link --- CHANGELOG.md | 11 +++++------ crates/storage/src/lazy/mapping.rs | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aacbef652ac..1d0e6dc0f45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,7 @@ compatible with the ink! `4.0.0` release. For full compatibility requirements see the [migration guide](https://use.ink/faq/migrating-from-ink-3-to-4/#compatibility). - Add `Mapping::contains(key)` and `Mapping::insert_return_size(key, val)` ‒ [#1224](/~https://github.com/paritytech/ink/pull/1224) -- Add [`payment-channel`](/~https://github.com/paritytech/ink/tree/master/examples/payment-channel) example ‒ [#1248](/~https://github.com/paritytech/ink/pull/1248) (thanks [@kanishkatn](/~https://github.com/kanishkatn)!) +- Add [`payment-channel`](/~https://github.com/paritytech/ink-examples/tree/main/payment-channel) example ‒ [#1248](/~https://github.com/paritytech/ink/pull/1248) (thanks [@kanishkatn](/~https://github.com/kanishkatn)!) - Add `version` field to ink! metadata ‒ [#1313](/~https://github.com/paritytech/ink/pull/1313) - The `rand-extension` example has been adapted to an updated version of the `ChainExtension` API ‒ [#1356](/~https://github.com/paritytech/ink/pull/1356) - Add `ink_env::pay_with_call!` helper macro for off-chain emulation of sending payments with contract message calls ‒ [#1379](/~https://github.com/paritytech/ink/pull/1379) @@ -363,7 +363,7 @@ return an `Option` instead of `()`. ### Added - :x: Add `Mapping::contains(key)` and `Mapping::insert_return_size(key, val)` ‒ [#1224](/~https://github.com/paritytech/ink/pull/1224) -- Add [`payment-channel`](/~https://github.com/paritytech/ink/tree/master/examples/payment-channel) example ‒ [#1248](/~https://github.com/paritytech/ink/pull/1248) +- Add [`payment-channel`](/~https://github.com/paritytech/ink-examples/tree/main/payment-channel) example ‒ [#1248](/~https://github.com/paritytech/ink/pull/1248) - :x: Add `version` field to ink! metadata ‒ [#1313](/~https://github.com/paritytech/ink/pull/1313) - The `rand-extension` example has been adapted to an updated version of the `ChainExtension` API ‒ [#1356](/~https://github.com/paritytech/ink/pull/1356) @@ -477,7 +477,7 @@ Additionally there are a couple new `ink_env` functions now: ### New Upgradeable Contract Example -We've added a new example: [`upgradeable-contracts/set-code-hash`](/~https://github.com/paritytech/ink/tree/master/examples/upgradeable-contracts#set-code-hash). +We've added a new example: [`upgradeable-contracts/set-code-hash`](/~https://github.com/paritytech/ink-examples/tree/main/upgradeable-contracts#set-code-hash#set-code-hash). It illustrates how the newly added [`ink_env::set_code_hash`](https://paritytech.github.io/ink/ink_env/fn.set_code_hash.html) can be used to implement an upgradeable contract that replaces its own code. @@ -534,7 +534,7 @@ for the API documentation. We've also switched all our examples to this new environment, you can find more "template use-cases" there (e.g. for -[chain extension testing](/~https://github.com/paritytech/ink/tree/master/examples/rand-extension)) +[chain extension testing](/~https://github.com/paritytech/ink-examples/tree/main/rand-extension)) #### We removed the dynamic storage allocator More details on the reasoning behind this can be found in [#1148](/~https://github.com/paritytech/ink/pull/1148). @@ -547,7 +547,7 @@ The `CallBuilder` API changed to now support two types of calls: * `DelegateCall`: a delegated call.
This enables writing upgradeable contracts using the `delegate` pattern. An example has been added to demonstrate this: - [`delegate-calls`](/~https://github.com/paritytech/ink/tree/master/examples/upgradeable-contracts/delegate-calls). + [`delegate-calls`](/~https://github.com/paritytech/ink-examples/tree/main/upgradeable-contracts). This is a breaking change, users must now specify the `call_type` to the builder manually. @@ -718,7 +718,6 @@ Specifically you need to upgrade to at least the pallet version ### Added - Added support for wildcard selectors ‒ [#1020](/~https://github.com/paritytech/ink/pull/1020). - This enables writing upgradeable smart contracts using the proxy/forward pattern. - We added a new example to illustrate this ‒ the [proxy](/~https://github.com/paritytech/ink/tree/master/examples/proxy) example. - Annotating a wildcard selector in traits is not supported. - The ink! codegen now heavily relies on static type information based on traits defined in `ink_lang` ‒ [#665](/~https://github.com/paritytech/ink/pull/665). - Some of those traits and their carried information can be used for static reflection of ink! diff --git a/crates/storage/src/lazy/mapping.rs b/crates/storage/src/lazy/mapping.rs index 9c853ac2549..73e276b0417 100644 --- a/crates/storage/src/lazy/mapping.rs +++ b/crates/storage/src/lazy/mapping.rs @@ -83,7 +83,7 @@ use scale::{ /// # } /// ``` /// -/// More usage examples can be found [in the ink! examples](/~https://github.com/paritytech/ink/tree/master/examples). +/// More usage examples can be found [in the ink! examples](/~https://github.com/paritytech/ink-examples). #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] pub struct Mapping { #[allow(clippy::type_complexity)] From d5c1f4a6b0d0dd389fd38dd4d1a9f7b8830a94d8 Mon Sep 17 00:00:00 2001 From: Javyer Date: Wed, 5 Apr 2023 14:35:25 +0200 Subject: [PATCH 3/3] Created cron job to show stale issues (#1739) * created action that will report about stale issues * added handling for empty messages * added `ink-examples` * added users to ignore lean-apple,juangirini,pgherveou * removed duplicated message in matrix message --- .github/workflows/issue-notifier.yml | 108 +++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/workflows/issue-notifier.yml diff --git a/.github/workflows/issue-notifier.yml b/.github/workflows/issue-notifier.yml new file mode 100644 index 00000000000..6033a327099 --- /dev/null +++ b/.github/workflows/issue-notifier.yml @@ -0,0 +1,108 @@ +name: Find stale issues + +on: + workflow_dispatch: + schedule: + # UTC Time + - cron: "0 7 * * 4" + +jobs: + fetch-issues: + runs-on: ubuntu-latest + strategy: + matrix: + # List of repositories to fetch the issues + repo: + - ink + - cargo-contract + - substrate-contracts-node + - contracts-ui + - ink-docs + - smart-bench + - ink-waterfall + - ink-playground + - nft-marketplace-demo + - pallet-contracts-xcm + - link + - ink-examples + steps: + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.ISSUE_TRACKER_APP_ID }} + private_key: ${{ secrets.ISSUE_TRACKER_APP_KEY }} + - name: Fetch issues from ${{ matrix.repo }} + id: issue + uses: paritytech/stale-issues-finder@main + with: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + repo: ${{ matrix.repo }} + # Users to ignore if they are authors. They are separated by commas + ignoreAuthors: ascjones,HCastano,Robbepop,athei,agryaznov,SkymanOne,xermicus,statictype,DoubleOTheven,cmichi,safina12,lean-apple,juangirini,pgherveou + # only fetch issues that don't have any replies + noComments: true + # from today onwards. Increase this number to set how much time without interaction must pass for the issue to be analyzed + days-stale: 0 + - run: mkdir outputs + - name: Write repo data + run: echo "$DATA" > "$FILE" + env: + DATA: ${{ steps.issue.outputs.data }} + FILE: outputs/${{ matrix.repo }}.json + - uses: actions/upload-artifact@v3 + with: + name: outputs + path: outputs/*.json + + message: + runs-on: ubuntu-latest + needs: fetch-issues + steps: + - name: Load outputs + uses: actions/download-artifact@v3 + with: + name: outputs + path: outputs + - name: Combine outputs + id: issues + run: | + COMBINED=$(jq -s 'reduce .[] as $x ([]; . + $x)' outputs/*.json | tr '\n' ' ') + COUNT=$(echo $COMBINED | jq length) + echo "# There are $COUNT stale issues" >> $GITHUB_STEP_SUMMARY + echo "ISSUES=$COMBINED" >> $GITHUB_OUTPUT + echo "COUNT=$COUNT" >> $GITHUB_OUTPUT + - name: Filter to the oldest issues + id: message + # Modify the number in reverse[:8] to change how many issues should be shown + run: | + if [ $COUNT = "0" ]; then + echo "MESSAGE=$EMPTY_MESSAGE" >> $GITHUB_OUTPUT + else + MESSAGE=$(echo $COMBINED | jq -r '. | sort_by(.daysStale) | reverse[:8]| .[] | "- [\(.title)](\(.url)) | \(.daysStale) days with no reply"') + delimiter="$(openssl rand -hex 8)" + echo "MESSAGE<<${delimiter}" >> "${GITHUB_OUTPUT}" + echo "$MESSAGE" >> "${GITHUB_OUTPUT}" + echo "${delimiter}" >> "${GITHUB_OUTPUT}" + fi + env: + COMBINED: ${{ steps.issues.outputs.ISSUES }} + COUNT: ${{ steps.issues.outputs.COUNT }} + # This is the message that will be shown when there are no + EMPTY_MESSAGE: "No stale issues! Good job!" + - name: send message + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: "!EBuECvRavzBxijipBi:parity.io" + access_token: ${{ secrets.STALE_MATRIX_ACCESS_TOKEN }} + # Remember to keep at least one empty line between paragraphs + message: | + ## Good morning, team 🥞! + This weekly digest lists GitHub issues without any reply that were created by non-team members. + + The list is an aggregation of repositories which the Smart Contracts ☂️ owns ([list](https://www.notion.so/paritytechnologies/What-belongs-to-our-umbrella-b9a80b72fedc47d6b35224a15bdec64c)). + + ${{ steps.message.outputs.MESSAGE }} + + Find all the stale issues [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). + server: "m.parity.io"