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

Is ownership(deps: Deps) really needed? #133

Open
taitruong opened this issue Jul 18, 2023 · 1 comment
Open

Is ownership(deps: Deps) really needed? #133

taitruong opened this issue Jul 18, 2023 · 1 comment

Comments

@taitruong
Copy link
Collaborator

taitruong commented Jul 18, 2023

From what I see, ownership(deps: Deps) is only used in one place (query):

QueryMsg::Ownership {} => to_binary(&Self::ownership(deps)?),
QueryMsg::Extension { msg: _ } => Ok(Binary::default()),
}
}
pub fn minter(&self, deps: Deps) -> StdResult<MinterResponse> {
let minter = cw_ownable::get_ownership(deps.storage)?
.owner
.map(|a| a.into_string());
Ok(MinterResponse { minter })
}
pub fn ownership(deps: Deps) -> StdResult<cw_ownable::Ownership<Addr>> {
cw_ownable::get_ownership(deps.storage)
}

So do we need to make this public? If so, maybe it is better re-exporting from ownable, like this:

// re-export to make it easier for anyone using this, without using ownable directly
pub use cw_ownable::get_ownership;
@taitruong taitruong changed the title ownership(deps: Deps) needed Is ownership(deps: Deps) really needed? Jul 18, 2023
@taitruong
Copy link
Collaborator Author

After checking it again, this is a bit confusing:

Since v0.17.0 cw-ownable replaces minter. So QueryMsg for Minter and Ownership is the same thing. So either minter should be noted as deprecated or one of these 2 should be removed.

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

No branches or pull requests

1 participant