Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connection): add option to unset ISM and hook #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aroralanuk
Copy link

Comment on lines +63 to +71
let removed_ism = get_ism(deps.storage)?
.map(|addr| addr.to_string())
.unwrap_or_else(|| "none".to_string());

ISM.remove(deps.storage);

Ok(event_to_resp(
new_event("unset_ism").add_attribute("ism", removed_ism),
))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo we dont really need to know what ISM was removed in the event

Suggested change
let removed_ism = get_ism(deps.storage)?
.map(|addr| addr.to_string())
.unwrap_or_else(|| "none".to_string());
ISM.remove(deps.storage);
Ok(event_to_resp(
new_event("unset_ism").add_attribute("ism", removed_ism),
))
ISM.remove(deps.storage);
Ok(event_to_resp(
new_event("unset_ism")
))

Comment on lines +86 to +96
None => {
let removed_hook = get_hook(deps.storage)?
.map(|addr| addr.to_string())
.unwrap_or_else(|| "none".to_string());

HOOK.remove(deps.storage);

Ok(event_to_resp(
new_event("unset_hook").add_attribute("hook", removed_hook),
))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
None => {
let removed_hook = get_hook(deps.storage)?
.map(|addr| addr.to_string())
.unwrap_or_else(|| "none".to_string());
HOOK.remove(deps.storage);
Ok(event_to_resp(
new_event("unset_hook").add_attribute("hook", removed_hook),
))
}
None => {
HOOK.remove(deps.storage);
Ok(event_to_resp(
new_event("unset_hook")
))
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Previously set hooks or ISMs cannot be unset, so contracts can't opt back into using the default hook / ISM
2 participants