Skip to content

Commit

Permalink
Update tests.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Sep 11, 2023
1 parent 0b36544 commit 5a4aa71
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions contracts/dao-dao-core/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,26 @@ fn test_admin_permissions() {
}
);

// DAO cannot unpause itself
let res = app.execute_contract(
core_with_admin_addr.clone(),
core_with_admin_addr.clone(),
&ExecuteMsg::Unpause {},
&[],
);
assert!(res.is_err());

// Random person cannot pause the DAO
let res = app.execute_contract(
Addr::unchecked("random"),
core_with_admin_addr.clone(),
&ExecuteMsg::Pause {
duration: Duration::Height(10),
},
&[],
);
assert!(res.is_err());

// Admin can unpause the DAO
let res = app.execute_contract(
Addr::unchecked("admin"),
Expand All @@ -1187,15 +1207,6 @@ fn test_admin_permissions() {
.unwrap();
assert_eq!(paused, PauseInfoResponse::Unpaused {});

// DAO cannot unpause itself
let res = app.execute_contract(
core_with_admin_addr.clone(),
core_with_admin_addr.clone(),
&ExecuteMsg::Unpause {},
&[],
);
assert!(res.is_err());

// Admin can nominate a new admin.
let res = app.execute_contract(
Addr::unchecked("admin"),
Expand Down

0 comments on commit 5a4aa71

Please sign in to comment.