Skip to content

Commit

Permalink
congress: remove temporal add_tc_dismiss_perm and gas adjustments i…
Browse files Browse the repository at this point in the history
…n the `execute` method
  • Loading branch information
robert-zaremba committed Dec 28, 2023
1 parent a2ba55c commit b798e26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
6 changes: 6 additions & 0 deletions congress/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ Change log entries are to be added to the Unreleased section. Example entry:

### Bug Fixes

## v1.2.0 (2023-12-28)

### Improvements

- Remove temporal `add_tc_dismiss_perm` and gas adjustments in the `execute` method related to the wrong Gas settings in the TC proposals (and missing checks mentioned in the v1.1.2 release).

## v1.1.2 (2023-12-28)

### Improvements
Expand Down
24 changes: 2 additions & 22 deletions congress/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,8 @@ impl Contract {
promise = promise.function_call(
action.method_name.clone(),
action.args.clone().into(),
// TODO: remove the following changes in v1.2
0, //action.deposit.0,
Gas(action.gas.0) - EXEC_SELF_GAS,
action.deposit.0,
Gas(action.gas.0),
);
}
result = promise.into();
Expand Down Expand Up @@ -573,25 +572,6 @@ impl Contract {
self.members.set(&m);
}
}

/// v1.1.2 release: we missed TC perm to dismiss a member from "self"
// TODO: we can remove this method in the next release
pub fn add_tc_dismiss_perm(&mut self) {
let tc = env::predecessor_account_id();
require!(tc.as_str() == "congress-tc-v1.ndc-gwg.near");
let mut hooks = self.hook_auth.get().unwrap();
match hooks.get_mut(&tc) {
None => {
hooks.insert(tc, vec![HookPerm::Dismiss]);
}
Some(tc_perms) => {
if !tc_perms.contains(&HookPerm::Dismiss) {
tc_perms.push(HookPerm::Dismiss);
}
}
}
self.hook_auth.set(&hooks);
}
}

#[cfg(all(test, not(target_arch = "wasm32")))]
Expand Down

0 comments on commit b798e26

Please sign in to comment.