Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/admin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ impl AdminContract {

// Verify new owner is different from current owner
if new_owner == current_owner {
panic_with_error!(&e, ContractError::InvalidPauseAction);
panic_with_error!(&e, ContractError::AdminUnchanged);
}

// Verify new owner is a SuperAdmin
Expand Down
6 changes: 6 additions & 0 deletions contracts/admin/src/pausable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,18 @@ pub fn execute_pause_proposal(e: &Env, proposal_id: u64) {
}

fn do_pause(e: &Env, proposal_id: Option<u64>, reason: &String) {
if is_paused(e) {
panic_with_error!(e, ContractError::ContractPaused);
}
e.storage().instance().set(&DataKey::Paused, &true);
e.events()
.publish((Symbol::new(e, "paused"),), (proposal_id, reason.clone()));
}

fn do_unpause(e: &Env, proposal_id: Option<u64>) {
if !is_paused(e) {
panic_with_error!(e, ContractError::InvalidPauseAction);
}
e.storage().instance().set(&DataKey::Paused, &false);
e.events()
.publish((Symbol::new(e, "unpaused"),), proposal_id);
Expand Down
6 changes: 6 additions & 0 deletions contracts/arbitration/src/pausable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,18 @@ pub fn execute_pause_proposal(e: &Env, proposal_id: u64) {
}

fn do_pause(e: &Env, proposal_id: Option<u64>, reason: &String) {
if is_paused(e) {
panic_with_error!(e, ContractError::ContractPaused);
}
e.storage().instance().set(&DataKey::Paused, &true);
e.events()
.publish((Symbol::new(e, "paused"),), (proposal_id, reason.clone()));
}

fn do_unpause(e: &Env, proposal_id: Option<u64>) {
if !is_paused(e) {
panic_with_error!(e, ContractError::InvalidPauseAction);
}
e.storage().instance().set(&DataKey::Paused, &false);
e.events()
.publish((Symbol::new(e, "unpaused"),), proposal_id);
Expand Down
Loading