Proposal codex upgrade#1366
Merged
bedeho merged 14 commits intoJoystream:content_directory_second_tryfrom Sep 28, 2020
iorveth:proposal_codex_upgrade
Merged
Proposal codex upgrade#1366bedeho merged 14 commits intoJoystream:content_directory_second_tryfrom iorveth:proposal_codex_upgrade
bedeho merged 14 commits intoJoystream:content_directory_second_tryfrom
iorveth:proposal_codex_upgrade
Conversation
…sal type & related logic
…sal type related logic
…to proposal_codex_upgrade
bedeho
requested changes
Sep 21, 2020
Member
bedeho
left a comment
There was a problem hiding this comment.
-
Haven't you forgot to update this so that the proposals actually work for the new working group? At least you would need to change enum
common::WorkingGroup, no? -
Also, some tests should have failed if I am correct, so there may be missing tests that actually attempt to submit proposals to this new working group
Contributor
Author
|
Thanks for pointing an issue! |
bedeho
requested changes
Sep 22, 2020
Member
There was a problem hiding this comment.
- Good fix on <= bug.
- Good fix on adding
Contentvariant. - You seem to have just replaced away all tests for Storage? dont we need tests to cover all active groups ? So we need tests for both storage and content, and whenever a new group is added, we need tests for that also? Can't you just in each test case basically iterate over all variants and call some core test logic for each case? So for example something like
#[test]
fn create_set_working_group_leader_reward_proposal_common_checks_succeed() {
// This uses strum crate for enum iteration
for group in WorkingGroup::iter() {
run_create_set_working_group_leader_reward_proposal_common_checks_succeed(group);
}
}
fn run_create_set_working_group_leader_reward_proposal_common_checks_succeed(group: WorkingGroup) {
initial_test_ext().execute_with(|| {
let proposal_fixture = ProposalTestFixture {
insufficient_rights_call: || {
ProposalCodex::create_set_working_group_leader_reward_proposal(
RawOrigin::None.into(),
1,
b"title".to_vec(),
b"body".to_vec(),
None,
0,
10,
group,
)
},
empty_stake_call: || {
ProposalCodex::create_set_working_group_leader_reward_proposal(
RawOrigin::Signed(1).into(),
1,
b"title".to_vec(),
b"body".to_vec(),
None,
0,
10,
group,
)
},
invalid_stake_call: || {
ProposalCodex::create_set_working_group_leader_reward_proposal(
RawOrigin::Signed(1).into(),
1,
b"title".to_vec(),
b"body".to_vec(),
Some(<BalanceOf<Test>>::from(5000u32)),
0,
10,
group,
)
},
successful_call: || {
ProposalCodex::create_set_working_group_leader_reward_proposal(
RawOrigin::Signed(1).into(),
1,
b"title".to_vec(),
b"body".to_vec(),
Some(<BalanceOf<Test>>::from(50000u32)),
10,
10,
group,
)
},
proposal_parameters:
crate::proposal_types::parameters::set_working_group_leader_reward_proposal::<Test>(
),
proposal_details: ProposalDetails::SetWorkingGroupLeaderReward(
10,
10,
group,
),
};
proposal_fixture.check_all();
});
}
``` …akingEventsHandler & StorageWgStakingEventsHandler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to
proposals_codexpallet according to Content directory integration work, part 2: Update proposals-codex pallet #1295