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

Approval query returns positive for Owner #47

Merged
merged 3 commits into from
Jan 31, 2022
Merged

Approval query returns positive for Owner #47

merged 3 commits into from
Jan 31, 2022

Conversation

orkunkl
Copy link
Contributor

@orkunkl orkunkl commented Jan 28, 2022

In an NFT project i had this case:

        // check if sender has approval
        nft_contract
            .approval(
                &deps.querier,
                token.id.clone(),
                info.sender.clone().into_string(),
                None,
            )
            .map_err(|_e| ContractError::Unauthorized {})?;

Where I only want to check if sender has permission to operate nft.
If the sender is owner, this query returns unauthorized. In order to make this work, I need to run one more owner query which makes things complicated and expensive.

@the-frey
Copy link
Collaborator

Looks good - suggest we merge #48 first, then the wasm build will succeed here and #45

@orkunkl orkunkl merged commit 7c33ea4 into main Jan 31, 2022
@orkunkl orkunkl deleted the owner-approval branch January 31, 2022 06:56
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.

3 participants