Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
h4x3rotab committed Oct 7, 2023
1 parent 6186a77 commit d0a15cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pallets/phala/src/compute/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pub mod pallet {
);

if pool_info.commission == payout_commission {
return Err(Error::<T>::CommissionNotChanged.into())
return Err(Error::<T>::CommissionNotChanged.into());
}
// Settle the shares anyway to ensure all the old commission is paid out
Self::maybe_gain_owner_shares(origin, pid)?;
Expand Down
12 changes: 6 additions & 6 deletions pallets/phala/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,7 @@ fn test_settle_vault_before_changing_commission() {
setup_workers(1);
setup_vault(3); // pid = 0, owner = 3
setup_stake_pool_with_workers(1, &[1]); // pid = 1, owner = 1

// Stake:
// Account2 -> Vault0:2 100
// Vault0 -> StakePool1: 100
Expand Down Expand Up @@ -1641,11 +1642,11 @@ fn test_settle_vault_before_changing_commission() {
let vault_info = ensure_vault::<Test>(0).unwrap();
assert_eq!(vault_info.basepool.total_value, 200 * DOLLARS);
assert_eq!(vault_info.basepool.total_shares, 100 * DOLLARS);
assert_ok!(
PhalaVault::set_payout_pref(
RuntimeOrigin::signed(3), 0, Some(Permill::from_percent(100))
)
);
assert_ok!(PhalaVault::set_payout_pref(
RuntimeOrigin::signed(3),
0,
Some(Permill::from_percent(100))
));
// Should get 0 share because the pre-settle commission rate is zero.
assert_ok!(PhalaVault::maybe_gain_owner_shares(
RuntimeOrigin::signed(3),
Expand All @@ -1654,7 +1655,6 @@ fn test_settle_vault_before_changing_commission() {
let vault_info = ensure_vault::<Test>(0).unwrap();
assert_eq!(vault_info.owner_shares, 0);
});

}

#[test]
Expand Down

0 comments on commit d0a15cc

Please sign in to comment.