From 376405e79d79bc3e07b58b75501829ce2b959b69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:54:33 +0200 Subject: [PATCH 1/5] Bump rustls-webpki from 0.101.3 to 0.101.4 (#134) Bumps [rustls-webpki](https://github.com/rustls/webpki) from 0.101.3 to 0.101.4. - [Release notes](https://github.com/rustls/webpki/releases) - [Commits](https://github.com/rustls/webpki/compare/v/0.101.3...v/0.101.4) --- updated-dependencies: - dependency-name: rustls-webpki dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alessio Treglia Co-authored-by: Pankaj --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f61d6bb4..6248a536 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6256,9 +6256,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.3" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ "ring", "untrusted", From f6ee0bfadd74cc0588a273708f703fa2d5044934 Mon Sep 17 00:00:00 2001 From: Polkaverse Date: Thu, 24 Aug 2023 19:06:46 +0530 Subject: [PATCH 2/5] updated runtime versions and fix bugs --- node/Cargo.toml | 4 ++-- pallets/community/src/benchmarking.rs | 2 +- pallets/community/src/lib.rs | 3 +++ pallets/user/src/lib.rs | 6 +++--- pallets/user/src/tests.rs | 2 +- runtime/Cargo.toml | 2 +- runtime/src/lib.rs | 4 ++-- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/node/Cargo.toml b/node/Cargo.toml index 5b3a7954..f2b908b0 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jur-node" -version = "2.0.1" +version = "2.0.2" edition = "2021" license = "Unlicense" publish = false @@ -55,7 +55,7 @@ frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/parityte frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } # Local Dependencies -jur-node-runtime = { version = "2.0.1", path = "../runtime" } +jur-node-runtime = { version = "2.0.2", path = "../runtime" } primitives = { package = 'jur-primitives', path = '../primitives' } # CLI-specific dependencies diff --git a/pallets/community/src/benchmarking.rs b/pallets/community/src/benchmarking.rs index 1b794162..24c8d64e 100644 --- a/pallets/community/src/benchmarking.rs +++ b/pallets/community/src/benchmarking.rs @@ -180,7 +180,7 @@ benchmarks! { Some("#E76080".into()) ).unwrap(); - let member: T::AccountId = whitelisted_caller(); + let member: T::AccountId = account("sub", 2, SEED); }: _( RawOrigin::Signed(member), T::Helper::community(1) diff --git a/pallets/community/src/lib.rs b/pallets/community/src/lib.rs index 6c415b0f..c26a3b07 100644 --- a/pallets/community/src/lib.rs +++ b/pallets/community/src/lib.rs @@ -397,7 +397,10 @@ pub mod pallet { let mut community_members = community.members.clone(); + ensure!(community.founder != member, Error::::AlreadyMember); + ensure!(!community_members.contains(&member), Error::::AlreadyMember); + community_members.push(member.clone()); community.members = community_members; diff --git a/pallets/user/src/lib.rs b/pallets/user/src/lib.rs index e450541f..bddae89d 100644 --- a/pallets/user/src/lib.rs +++ b/pallets/user/src/lib.rs @@ -117,10 +117,10 @@ pub mod pallet { } // Validating the duplicate username - for (_, userdata) in Users::::iter() { + for (account, userdata) in Users::::iter() { ensure!( - userdata.name != name || userdata.name == None, - Error::::UsernameNotAvailable + userdata.name != name || userdata.name == None || + ( account == user && userdata.name == name),Error::::UsernameNotAvailable ); } diff --git a/pallets/user/src/tests.rs b/pallets/user/src/tests.rs index e4c878fa..c711d414 100644 --- a/pallets/user/src/tests.rs +++ b/pallets/user/src/tests.rs @@ -30,7 +30,7 @@ fn update_user_not_works_with_existing_name() { ); assert_noop!( User::update_user( - RuntimeOrigin::signed(1), + RuntimeOrigin::signed(2), Some("Alice".as_bytes().to_vec().try_into().unwrap()), Some("avatar".as_bytes().to_vec().try_into().unwrap()) ), diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index cdd65477..6e87457b 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jur-node-runtime" -version = "2.0.1" +version = "2.0.2" edition = "2021" license = "Unlicense" publish = false diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 3ea022ee..154f7a7c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -120,7 +120,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 105, + spec_version: 113, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -338,7 +338,7 @@ impl pallet_sudo::Config for Runtime { parameter_types! { pub Prefix: &'static [u8] = b"My JUR address is "; pub const NativeCurrencyId: CurrencyId = NATIVE_CURRENCY_ID; - pub const EthAddress: EthereumAddress = EthereumAddress(hex!("D77229999a1ca62b5bfb2735BaC12069b3794c44")); + pub const EthAddress: EthereumAddress = EthereumAddress(hex!("37abc97DD3dA0b81fe635e35Ea1655A15FfF4d76")); } /// Configure the pallet-token-swap in pallets/token-swap. From 79a21bba4c89ccaf307a3f6d58f9fd1433be37bb Mon Sep 17 00:00:00 2001 From: Polkaverse Date: Fri, 25 Aug 2023 12:48:04 +0530 Subject: [PATCH 3/5] updated reserve slots for jur commuity passport --- Cargo.lock | 4 ++-- pallets/passport/src/benchmarking.rs | 4 ++-- pallets/passport/src/tests.rs | 2 +- primitives/src/macros.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6248a536..c3438c9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3324,7 +3324,7 @@ dependencies = [ [[package]] name = "jur-node" -version = "2.0.1" +version = "2.0.2" dependencies = [ "clap", "frame-benchmarking", @@ -3370,7 +3370,7 @@ dependencies = [ [[package]] name = "jur-node-runtime" -version = "2.0.1" +version = "2.0.2" dependencies = [ "frame-benchmarking", "frame-executive", diff --git a/pallets/passport/src/benchmarking.rs b/pallets/passport/src/benchmarking.rs index e793b53d..26613538 100644 --- a/pallets/passport/src/benchmarking.rs +++ b/pallets/passport/src/benchmarking.rs @@ -81,7 +81,7 @@ benchmarks! { ) verify { assert_last_event::(Event::::MintedPassport( - ::Helper::passport(4851) + ::Helper::passport(5001) ).into()); } @@ -104,7 +104,7 @@ benchmarks! { }: _(RawOrigin::Signed(member), community_id, bounded_passport_address) verify { assert_last_event::(Event::::UpdatedPassport( - ::Helper::passport(4851) + ::Helper::passport(5001) ).into()); } diff --git a/pallets/passport/src/tests.rs b/pallets/passport/src/tests.rs index acaa572c..8240b01b 100644 --- a/pallets/passport/src/tests.rs +++ b/pallets/passport/src/tests.rs @@ -63,7 +63,7 @@ fn mint_passport_works_for_founder() { add_founder(); create_community(); assert_ok!(Passport::mint(RuntimeOrigin::signed(1), 1)); - assert_eq!(Passports::::get(1, 1).unwrap().id, 4851); + assert_eq!(Passports::::get(1, 1).unwrap().id, 5001); create_community(); assert_ok!(Passport::mint(RuntimeOrigin::signed(1), 2)); assert_eq!(Passports::::get(2, 1).unwrap().id, 1); diff --git a/primitives/src/macros.rs b/primitives/src/macros.rs index 9ca7ca7e..c59351ae 100644 --- a/primitives/src/macros.rs +++ b/primitives/src/macros.rs @@ -14,7 +14,7 @@ macro_rules! impl_incrementable { } fn jur_community_reserve_slots() -> Self { - 4851 + 5001 } } )+ From 80ef21ce969192b1a0d95e37ce810922ad0bb8d2 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 25 Aug 2023 11:28:55 +0200 Subject: [PATCH 4/5] Update runtime/src/lib.rs Co-authored-by: Pankaj --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 154f7a7c..6dbd75b9 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -338,7 +338,7 @@ impl pallet_sudo::Config for Runtime { parameter_types! { pub Prefix: &'static [u8] = b"My JUR address is "; pub const NativeCurrencyId: CurrencyId = NATIVE_CURRENCY_ID; - pub const EthAddress: EthereumAddress = EthereumAddress(hex!("37abc97DD3dA0b81fe635e35Ea1655A15FfF4d76")); + pub const EthAddress: EthereumAddress = EthereumAddress(hex!("D77229999a1ca62b5bfb2735BaC12069b3794c44")); } /// Configure the pallet-token-swap in pallets/token-swap. From 9539bdff33e2cb5ec4c83270acfac0372ca44fa9 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 25 Aug 2023 11:29:08 +0200 Subject: [PATCH 5/5] Update runtime/src/lib.rs Co-authored-by: Pankaj --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 6dbd75b9..7e52e9d8 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -120,7 +120,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 113, + spec_version: 106, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,