Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Update cw-721 to 0.17.0 #137

Merged
merged 3 commits into from
May 9, 2023
Merged

Update cw-721 to 0.17.0 #137

merged 3 commits into from
May 9, 2023

Conversation

grod220
Copy link
Contributor

@grod220 grod220 commented May 2, 2023

This primarily affects how the minting role is handled. Now there is a separate message to manage Ownership using cw-ownable.

Comment on lines -50 to -60
// Parent::default().instantiate() copied below
// Cannot use given it overrides contract version
let info = ContractInfoResponse {
name: msg.name,
symbol: msg.symbol,
};
Parent::default().contract_info.save(deps.storage, &info)?;
let minter = deps.api.addr_validate(&msg.minter)?;
Parent::default().minter.save(deps.storage, &minter)?;

Ok(Response::default())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer an issue as the base contract doesn't set the contract version anymore

Comment on lines +18 to +32
#[test]
fn only_token_owner_can_burn() {
let mut mock = MockEnv::new().build().unwrap();

let user = Addr::unchecked("user");
let token_id = mock.mint(&user).unwrap();
mock.set_health_response(&user, &token_id, &below_max_for_burn());

let bad_guy = Addr::unchecked("bad_guy");
let res = mock.burn(&bad_guy, &token_id);
let err: ContractError = res.unwrap_err().downcast().unwrap();
assert_eq!(err, BaseError(Ownership(NotOwner)));

mock.burn(&user, &token_id).unwrap();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved from other test file. Better fits here given this is the burn test suite.

@grod220 grod220 requested a review from larry0x May 2, 2023 14:01
@grod220 grod220 force-pushed the MP-2534-update-cw-721-to-0-17 branch from f36c46a to 071ac22 Compare May 3, 2023 09:42
@grod220 grod220 force-pushed the MP-2534-update-cw-721-to-0-17 branch from 071ac22 to 2a857f2 Compare May 3, 2023 09:43
Copy link
Contributor

@piobab piobab left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@larry0x larry0x left a comment

Choose a reason for hiding this comment

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

@grod220 I think we need a migrate entry point on the NFT contract?

See the discussion in this PR: public-awesome/cw-nfts#119

@grod220 grod220 force-pushed the MP-2534-update-cw-721-to-0-17 branch from 213a974 to fff2c09 Compare May 9, 2023 09:32
@grod220 grod220 force-pushed the MP-2534-update-cw-721-to-0-17 branch from fff2c09 to 4836c8e Compare May 9, 2023 09:41
@grod220 grod220 requested a review from larry0x May 9, 2023 09:50
Comment on lines +43 to +44
cw721 = { git = "https://github.com/CosmWasm/cw-nfts/", branch = "main" }
cw721-base = { git = "https://github.com/CosmWasm/cw-nfts/", branch = "main", features = ["library"] }
Copy link
Contributor

Choose a reason for hiding this comment

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

We should ask them to make a v0.17.1 release to include the features you need

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. I assumed they'd cut a new release in the next few weeks or so and we can come back and pin this to that version.

@grod220 grod220 merged commit 3502d63 into master May 9, 2023
@grod220 grod220 deleted the MP-2534-update-cw-721-to-0-17 branch May 9, 2023 10:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants