Skip to content

Commit

Permalink
Bug fixes (#118)
Browse files Browse the repository at this point in the history
* updated initial vale to 1 and tagline limit

* fixed username bugs

---------

Co-authored-by: Alessio Treglia <[email protected]>
  • Loading branch information
Polkaverse and Alessio Treglia authored Aug 17, 2023
1 parent c2cc87b commit 5ed564c
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 133 deletions.
28 changes: 14 additions & 14 deletions pallets/community/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ benchmarks! {
Some("#E76080".into())
)
verify {
assert!(Communities::<T>::get(T::Helper::community(0)).is_some());
assert!(Communities::<T>::get(T::Helper::community(1)).is_some());
}

update_community {
Expand All @@ -80,10 +80,10 @@ benchmarks! {
let description = "Jur is the core community of the Jur ecosystem";

}: _(
RawOrigin::Signed(caller), T::Helper::community(0), Some(logo.into()), Some(description.into())
RawOrigin::Signed(caller), T::Helper::community(1), Some(logo.into()), Some(description.into())
)
verify {
assert_last_event::<T>(Event::<T>::UpdatedCommunity(T::Helper::community(0)).into());
assert_last_event::<T>(Event::<T>::UpdatedCommunity(T::Helper::community(1)).into());
}

update_metadata {
Expand Down Expand Up @@ -125,10 +125,10 @@ benchmarks! {
};

}: _(
RawOrigin::Signed(caller), T::Helper::community(0), community_metadata
RawOrigin::Signed(caller), T::Helper::community(1), community_metadata
)
verify {
assert_last_event::<T>(Event::<T>::UpdatedMetadata(T::Helper::community(0)).into());
assert_last_event::<T>(Event::<T>::UpdatedMetadata(T::Helper::community(1)).into());
}

accept_members {
Expand All @@ -154,10 +154,10 @@ benchmarks! {
let members = vec![account("sub", 2, SEED), account("sub", 3, SEED)];

}: _(
RawOrigin::Signed(caller), T::Helper::community(0), members
RawOrigin::Signed(caller), T::Helper::community(1), members
)
verify {
assert_last_event::<T>(Event::<T>::AddedMembers(T::Helper::community(0)).into());
assert_last_event::<T>(Event::<T>::AddedMembers(T::Helper::community(1)).into());
}

join_community {
Expand All @@ -183,10 +183,10 @@ benchmarks! {
let member: T::AccountId = whitelisted_caller();

}: _(
RawOrigin::Signed(member), T::Helper::community(0)
RawOrigin::Signed(member), T::Helper::community(1)
)
verify {
assert_last_event::<T>(Event::<T>::JoinedCommunity(T::Helper::community(0)).into());
assert_last_event::<T>(Event::<T>::JoinedCommunity(T::Helper::community(1)).into());
}

leave_community {
Expand All @@ -210,10 +210,10 @@ benchmarks! {
).unwrap();

}: _(
RawOrigin::Signed(member), T::Helper::community(0)
RawOrigin::Signed(member), T::Helper::community(1)
)
verify {
assert_last_event::<T>(Event::<T>::LeavedCommunity(T::Helper::community(0)).into());
assert_last_event::<T>(Event::<T>::LeavedCommunity(T::Helper::community(1)).into());
}

remove_member {
Expand All @@ -238,7 +238,7 @@ benchmarks! {
).unwrap();

}: _(
RawOrigin::Signed(caller), member.clone(), T::Helper::community(0)
RawOrigin::Signed(caller), member.clone(), T::Helper::community(1)
)
verify {
assert_last_event::<T>(Event::<T>::RemovedMember(member).into());
Expand Down Expand Up @@ -269,10 +269,10 @@ benchmarks! {
let s_color = "#222308";

}: _(
RawOrigin::Signed(caller), T::Helper::community(0), Some(tag.into()), Some(p_color.into()), Some(s_color.into())
RawOrigin::Signed(caller), T::Helper::community(1), Some(tag.into()), Some(p_color.into()), Some(s_color.into())
)
verify {
assert_last_event::<T>(Event::<T>::UpdatedTagAndColors(T::Helper::community(0)).into());
assert_last_event::<T>(Event::<T>::UpdatedTagAndColors(T::Helper::community(1)).into());
}

impl_benchmark_test_suite!(Community, crate::mock::new_test_ext(), crate::mock::Test);
Expand Down
Loading

0 comments on commit 5ed564c

Please sign in to comment.