Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Nov 19, 2021

It seemed to not make much sense to make a call to the CollectiblesController in the background to validate ownership, immediately before calling the same controller to add that collectible. This PR adds a new method addCollectibleVerifyOwnership which wraps the addCollectible method together with the validation step.

@adonesky1 adonesky1 force-pushed the add-collectible-validation-in-add-method branch 3 times, most recently from 7314c2a to 4d638db Compare November 22, 2021 15:18
@adonesky1 adonesky1 force-pushed the add-collectible-validation-in-add-method branch 2 times, most recently from 419cc66 to 8fdec38 Compare November 22, 2021 21:10
image: 'image',
description: 'description',
standard: 'standard',
describe('addCollectibleVerifyOwnership', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TLDR: I reorganized the tests such that each major method has its own describe block.

image: 'image',
description: 'description',
standard: 'standard',
it('should throw an error if selected address is not owner of input collectible', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only new test in this file. The rest are just shuffled around.

@adonesky1 adonesky1 marked this pull request as ready for review November 22, 2021 21:14
@adonesky1 adonesky1 requested a review from a team as a code owner November 22, 2021 21:14
@adonesky1 adonesky1 force-pushed the add-collectible-validation-in-add-method branch from 8fdec38 to ab88d1f Compare November 22, 2021 21:16
@adonesky1 adonesky1 changed the title [WIP] Add ownership validation directly in addCollectible method Add new method addCollectibleVerifyOwnership Nov 22, 2021
gantunesr
gantunesr previously approved these changes Nov 23, 2021
Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

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

LGTM. Just a little nit, the method name, but I have no better suggestion

});
});

it('should add collectible by selected address', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this test is no longer preset. Was it removed accidentally?

I see that there is now an equivalent test for your new method, but not for addCollectible, which is what this tested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I replaced it with a test for my method. I will add it back for addCollectible and rename it slightly and keep it for testing the new method as well? Sound good @Gudahtt?

wachunei
wachunei previously approved these changes Nov 23, 2021
@adonesky1 adonesky1 dismissed stale reviews from wachunei and gantunesr via 2041317 November 23, 2021 19:10
@adonesky1
Copy link
Contributor Author

@wachunei @gantunesr just added a test! @Gudahtt should be good for another look.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@adonesky1 adonesky1 merged commit 3ea1259 into main Nov 23, 2021
@adonesky1 adonesky1 deleted the add-collectible-validation-in-add-method branch November 23, 2021 19:40
@adonesky1 adonesky1 mentioned this pull request Nov 24, 2021
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* add addCollectibleVerifyOwnership method for manually added collectibles

* update tests

* address feedback
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* add addCollectibleVerifyOwnership method for manually added collectibles

* update tests

* address feedback
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.

5 participants