-
Notifications
You must be signed in to change notification settings - Fork 353
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
Allow modifying admin of Ics20 contract #641
Conversation
ethanfrey
commented
Jan 31, 2022
- Use ADMIN rather then config
- Support standard ADMIN query and update
- Add migration support from current version to new version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Ok(Response::new()) | ||
} | ||
|
||
fn from_semver(err: semver::Error) -> StdError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
@@ -251,9 +298,10 @@ pub fn query_channel(deps: Deps, id: String) -> StdResult<ChannelResponse> { | |||
|
|||
fn query_config(deps: Deps) -> StdResult<ConfigResponse> { | |||
let cfg = CONFIG.load(deps.storage)?; | |||
let admin = ADMIN.get(deps)?.unwrap_or_else(|| Addr::unchecked("")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Wouldn't "None"
be better here? I think we used that in the past.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this contract, we don't allow None, so it doesn't map much to the ADMIN, I kind of force it
} | ||
|
||
Ok(Response::new()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now, but I wonder how much of this logic can be turned into a helper function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of this is in poe-contracts/tg-utils
but matching on versions would be a good thing to abstract out (later, when we have some good examples/experience)
2a0d550
to
20c2177
Compare