-
Notifications
You must be signed in to change notification settings - Fork 115
Proposal codex upgrade #1366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal codex upgrade #1366
Conversation
…sal type & related logic
…sal type related logic
…to proposal_codex_upgrade
shamil-gadelshin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bedeho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
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
|
Thanks for pointing an issue! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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
bedeho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
This PR aims to
proposals_codexpallet according to Content directory integration work, part 2: Update proposals-codex pallet #1295