|
@@ -16,10 +16,7 @@ use frame_system::{EventRecord, Phase};
|
|
|
pub(crate) fn increase_total_balance_issuance_using_account_id(account_id: u64, balance: u64) {
|
|
|
let initial_balance = Balances::total_issuance();
|
|
|
{
|
|
|
- let _ = <Test as common::currency::GovernanceCurrency>::Currency::deposit_creating(
|
|
|
- &account_id,
|
|
|
- balance,
|
|
|
- );
|
|
|
+ let _ = Balances::deposit_creating(&account_id, balance);
|
|
|
}
|
|
|
assert_eq!(Balances::total_issuance(), initial_balance + balance);
|
|
|
}
|
|
@@ -1042,10 +1039,7 @@ fn create_dummy_proposal_succeeds_with_stake() {
|
|
|
.with_account_id(account_id)
|
|
|
.with_stake(account_id);
|
|
|
|
|
|
- let _imbalance = <Test as common::currency::GovernanceCurrency>::Currency::deposit_creating(
|
|
|
- &account_id,
|
|
|
- 500,
|
|
|
- );
|
|
|
+ let _imbalance = Balances::deposit_creating(&account_id, 500);
|
|
|
|
|
|
let proposal_id = dummy_proposal.create_proposal_and_assert(Ok(1)).unwrap();
|
|
|
|
|
@@ -1166,19 +1160,13 @@ fn finalize_expired_proposal_and_check_stake_removing_with_balance_checks_succee
|
|
|
.with_stake(1);
|
|
|
|
|
|
let account_balance = 500;
|
|
|
- let _imbalance = <Test as common::currency::GovernanceCurrency>::Currency::deposit_creating(
|
|
|
- &account_id,
|
|
|
- account_balance,
|
|
|
- );
|
|
|
+ let _imbalance = Balances::deposit_creating(&account_id, account_balance);
|
|
|
|
|
|
- assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::usable_balance(&account_id),
|
|
|
- account_balance
|
|
|
- );
|
|
|
+ assert_eq!(Balances::usable_balance(&account_id), account_balance);
|
|
|
|
|
|
let proposal_id = dummy_proposal.create_proposal_and_assert(Ok(1)).unwrap();
|
|
|
assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::usable_balance(&account_id),
|
|
|
+ Balances::usable_balance(&account_id),
|
|
|
account_balance - stake_amount
|
|
|
);
|
|
|
|
|
@@ -1206,7 +1194,7 @@ fn finalize_expired_proposal_and_check_stake_removing_with_balance_checks_succee
|
|
|
|
|
|
let rejection_fee = RejectionFee::get();
|
|
|
assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::usable_balance(&account_id),
|
|
|
+ Balances::usable_balance(&account_id),
|
|
|
account_balance - rejection_fee
|
|
|
);
|
|
|
});
|
|
@@ -1238,19 +1226,13 @@ fn proposal_cancellation_with_slashes_with_balance_checks_succeeds() {
|
|
|
.with_stake(1);
|
|
|
|
|
|
let account_balance = 500;
|
|
|
- let _imbalance = <Test as common::currency::GovernanceCurrency>::Currency::deposit_creating(
|
|
|
- &account_id,
|
|
|
- account_balance,
|
|
|
- );
|
|
|
+ let _imbalance = Balances::deposit_creating(&account_id, account_balance);
|
|
|
|
|
|
- assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::usable_balance(&account_id),
|
|
|
- account_balance
|
|
|
- );
|
|
|
+ assert_eq!(Balances::usable_balance(&account_id), account_balance);
|
|
|
|
|
|
let proposal_id = dummy_proposal.create_proposal_and_assert(Ok(1)).unwrap();
|
|
|
assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::usable_balance(&account_id),
|
|
|
+ Balances::usable_balance(&account_id),
|
|
|
account_balance - stake_amount
|
|
|
);
|
|
|
|
|
@@ -1282,7 +1264,7 @@ fn proposal_cancellation_with_slashes_with_balance_checks_succeeds() {
|
|
|
|
|
|
let cancellation_fee = CancellationFee::get();
|
|
|
assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::total_balance(&account_id),
|
|
|
+ Balances::total_balance(&account_id),
|
|
|
account_balance - cancellation_fee
|
|
|
);
|
|
|
});
|
|
@@ -1316,20 +1298,14 @@ fn proposal_slashing_succeeds() {
|
|
|
.with_account_id(account_id.clone())
|
|
|
.with_stake(account_id);
|
|
|
|
|
|
- assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::total_balance(&account_id),
|
|
|
- initial_balance
|
|
|
- );
|
|
|
+ assert_eq!(Balances::total_balance(&account_id), initial_balance);
|
|
|
|
|
|
let proposal_id = dummy_proposal.create_proposal_and_assert(Ok(1)).unwrap();
|
|
|
|
|
|
- assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::total_balance(&account_id),
|
|
|
- initial_balance
|
|
|
- );
|
|
|
+ assert_eq!(Balances::total_balance(&account_id), initial_balance);
|
|
|
|
|
|
assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::usable_balance(&account_id),
|
|
|
+ Balances::usable_balance(&account_id),
|
|
|
initial_balance - stake_amount
|
|
|
);
|
|
|
|
|
@@ -1344,7 +1320,7 @@ fn proposal_slashing_succeeds() {
|
|
|
assert!(!<crate::Proposals<Test>>::contains_key(proposal_id));
|
|
|
|
|
|
assert_eq!(
|
|
|
- <Test as common::currency::GovernanceCurrency>::Currency::total_balance(&account_id),
|
|
|
+ Balances::total_balance(&account_id),
|
|
|
initial_balance - stake_amount
|
|
|
);
|
|
|
|