|
@@ -796,7 +796,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn member_create_proposal() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
assert_eq!(Proposals::active_proposal_ids().len(), 1);
|
|
@@ -841,7 +841,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn cannot_create_proposal_with_small_stake() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_eq!(
|
|
|
_create_proposal(None, Some(min_stake() - 1), None, None, None),
|
|
@@ -857,7 +857,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn cannot_create_proposal_when_stake_is_greater_than_balance() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_eq!(
|
|
|
_create_proposal(None, Some(initial_balance() + 1), None, None, None),
|
|
@@ -873,7 +873,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn cannot_create_proposal_with_empty_values() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
// Empty name:
|
|
|
assert_eq!(
|
|
@@ -898,7 +898,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn cannot_create_proposal_with_too_long_values() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
// Too long name:
|
|
|
assert_eq!(
|
|
@@ -938,7 +938,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn owner_cancel_proposal() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
assert_ok!(Proposals::cancel_proposal(Origin::signed(PROPOSER1), 1));
|
|
@@ -959,7 +959,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn owner_cannot_cancel_proposal_if_its_finalized() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
assert_ok!(Proposals::cancel_proposal(Origin::signed(PROPOSER1), 1));
|
|
@@ -986,8 +986,8 @@ mod tests {
|
|
|
#[test]
|
|
|
fn not_owner_cannot_cancel_proposal() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
- Balances::deposit_creating(&PROPOSER2, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER2, initial_balance());
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
assert_eq!(
|
|
|
Proposals::cancel_proposal(Origin::signed(PROPOSER2), 1),
|
|
@@ -1002,7 +1002,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn councilor_vote_on_proposal() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1026,7 +1026,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn councilor_cannot_vote_on_proposal_twice() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1045,7 +1045,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn autovote_with_approve_when_councilor_creates_proposal() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&COUNCILOR1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&COUNCILOR1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_proposal(Some(COUNCILOR1), None, None, None, None));
|
|
|
|
|
@@ -1062,7 +1062,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn not_councilor_cannot_vote_on_proposal() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
assert_eq!(
|
|
@@ -1075,7 +1075,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn councilor_cannot_vote_on_proposal_if_it_has_been_cancelled() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
assert_ok!(Proposals::cancel_proposal(Origin::signed(PROPOSER1), 1));
|
|
@@ -1089,7 +1089,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn councilor_cannot_vote_on_proposal_if_tally_has_been_finalized() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1129,7 +1129,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn approve_proposal_when_all_councilors_approved_it() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1183,7 +1183,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn approve_proposal_when_all_councilors_voted_and_only_quorum_approved() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1239,7 +1239,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn approve_proposal_when_voting_period_expired_if_only_quorum_voted() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1301,7 +1301,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn reject_proposal_when_all_councilors_voted_and_quorum_not_reached() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1360,7 +1360,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn reject_proposal_when_all_councilors_rejected_it() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1417,7 +1417,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn slash_proposal_when_all_councilors_slashed_it() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|
|
@@ -1483,7 +1483,7 @@ mod tests {
|
|
|
#[test]
|
|
|
fn expire_proposal_when_not_all_councilors_voted_and_quorum_not_reached() {
|
|
|
with_externalities(&mut new_test_ext(), || {
|
|
|
- Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
+ let _ = Balances::deposit_creating(&PROPOSER1, initial_balance());
|
|
|
|
|
|
assert_ok!(_create_default_proposal());
|
|
|
|