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

fix issue 208 allow minting after burn #215

Merged
merged 4 commits into from
Oct 17, 2022

Conversation

bmacer
Copy link
Contributor

@bmacer bmacer commented Sep 12, 2022

addresses #208

Copy link
Contributor

@ilionic ilionic left a comment

Choose a reason for hiding this comment

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

Please run and fix integration test:

  1) integration test: lock collection
       lock collection with minting:

      AssertionError: expected +0 to equal 5
      + expected - actual

      -0
      +5

@ilionic ilionic removed the request for review from HashWarlock September 16, 2022 20:07
@bmacer
Copy link
Contributor Author

bmacer commented Oct 7, 2022

I merged main into this branch, then went ahead trying to fix the integration test. But it didn't seem to fail for me. I'd be surprised if the merge from main fixed it.

Can you double-check the integration test is failing on your end?

bmacer@BMACER-M-XRG9 tests % git branch
* bug/208-locked-collection-allow-minting-after-burn
  main
bmacer@BMACER-M-XRG9 tests % yarn testLockCollection
yarn run v1.22.18
$ mocha --timeout 9999999 -r ts-node/register './src/lockCollection.test.ts'


  integration test: lock collection
    ✔ lock collection (2168ms)
    ✔ [negative] lock non-existing NFT collection (1996ms)
    ✔ [negative] lock not an owner NFT collection issuer (3991ms)
    ✔ lock collection with minting (14017ms)
    ✔ [negative] unable to mint NFT inside a locked collection (6001ms)
    ✔ [negative] unable to mint NFT inside a full collection (5996ms)


  6 passing (34s)

✨  Done in 38.46s.

@bmacer bmacer requested a review from ilionic October 7, 2022 12:51
@ilionic
Copy link
Contributor

ilionic commented Oct 10, 2022

@bmacer yes integration tests pass now, but unit test fails:

failures:

---- tests::lock_collection_works stdout ----
thread 'tests::lock_collection_works' panicked at 'assertion failed: `(left == right)`
  left: `Ok(())`,
 right: `Err(Module(ModuleError { index: 2, error: [14, 0, 0, 0], message: Some("CollectionFullOrLocked") }))`', pallets/rmrk-core/src/tests.rs:149:9

Copy link
Contributor

@ilionic ilionic left a comment

Choose a reason for hiding this comment

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

Please adjust unit test

@bmacer
Copy link
Contributor Author

bmacer commented Oct 17, 2022

@ilionic
Turns out when I merged main, I undid my changes, so we returned to the original state. I fixed this.
The integration test was failing because it was checking that max for the collection == collection size, which is the logic we changed. Now in all cases, max is set to 0 on locking. I changed the integration test to reflect this, and the test testLockCollection is now passing. Also, unit tests are passing. Should be good now.

@bmacer bmacer requested a review from ilionic October 17, 2022 14:09
@ilionic ilionic requested a review from HashWarlock October 17, 2022 16:18
Copy link
Contributor

@ilionic ilionic left a comment

Choose a reason for hiding this comment

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

Thanks @bmacer, LGTM
@HashWarlock please take a look and feel free to merge if all good.

Copy link
Contributor

@HashWarlock HashWarlock left a comment

Choose a reason for hiding this comment

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

LGTM

@ilionic ilionic merged commit bb505e6 into main Oct 17, 2022
@ilionic ilionic deleted the bug/208-locked-collection-allow-minting-after-burn branch October 17, 2022 18:09
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