-
Notifications
You must be signed in to change notification settings - Fork 842
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
Remove ERC721ASetOwnersExplicit extension #290
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,6 +454,21 @@ const createTestSuite = ({ contract, constructorArgs }) => | |
expect(await this.erc721a.exists(this.tokenIdToBurn)).to.be.false; | ||
}); | ||
}); | ||
|
||
describe('_initializeOwnershipAt', async function () { | ||
it('successfuly sets ownership of empty slot', async function () { | ||
const lastTokenId = this.addr3.expected.tokens[2]; | ||
expect(await this.erc721a.ownerOf(lastTokenId)).to.be.equal(this.addr3.address); | ||
const tx1 = await this.erc721a.initializeOwnershipAt(lastTokenId); | ||
expect(await this.erc721a.ownerOf(lastTokenId)).to.be.equal(this.addr3.address); | ||
const tx2 = await this.erc721a.initializeOwnershipAt(lastTokenId); | ||
|
||
// We assume the initialization worked due to less gas used by the 2nd txn | ||
const receipt1 = await tx1.wait(); | ||
const receipt2 = await tx2.wait(); | ||
expect(receipt1.gasUsed.toNumber()).to.be.greaterThan(receipt2.gasUsed.toNumber()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a best-efforst heuristic to determine whether or not the initialization call worked because we can't directly access |
||
}); | ||
}); | ||
}); | ||
|
||
context('test mint functionality', function () { | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a best-efforst heuristic to determine whether or not the initialization call worked because we can't directly access
_packedOwnerships
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can access
_ownershipAt
, which is internal.But big brain trick haha.