Refactor supports interface (#4817)
This commit is contained in:
@ -96,7 +96,7 @@ describe('Governor', function () {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
shouldSupportInterfaces(['ERC165', 'ERC1155Receiver', 'Governor']);
|
shouldSupportInterfaces(['ERC1155Receiver', 'Governor']);
|
||||||
shouldBehaveLikeERC6372(mode);
|
shouldBehaveLikeERC6372(mode);
|
||||||
|
|
||||||
it('deployment check', async function () {
|
it('deployment check', async function () {
|
||||||
|
|||||||
@ -754,7 +754,7 @@ function shouldBehaveLikeERC1155() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
shouldSupportInterfaces(['ERC165', 'ERC1155', 'ERC1155MetadataURI']);
|
shouldSupportInterfaces(['ERC1155', 'ERC1155MetadataURI']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ describe('ERC1155Holder', function () {
|
|||||||
Object.assign(this, await loadFixture(fixture));
|
Object.assign(this, await loadFixture(fixture));
|
||||||
});
|
});
|
||||||
|
|
||||||
shouldSupportInterfaces(['ERC165', 'ERC1155Receiver']);
|
shouldSupportInterfaces(['ERC1155Receiver']);
|
||||||
|
|
||||||
it('receives ERC1155 tokens from a single ID', async function () {
|
it('receives ERC1155 tokens from a single ID', async function () {
|
||||||
await this.token.connect(this.owner).safeTransferFrom(this.owner, this.mock, ids[0], values[0], data);
|
await this.token.connect(this.owner).safeTransferFrom(this.owner, this.mock, ids[0], values[0], data);
|
||||||
|
|||||||
@ -20,7 +20,7 @@ function shouldBehaveLikeERC721() {
|
|||||||
Object.assign(this, { owner, newOwner, approved, operator, other });
|
Object.assign(this, { owner, newOwner, approved, operator, other });
|
||||||
});
|
});
|
||||||
|
|
||||||
shouldSupportInterfaces(['ERC165', 'ERC721']);
|
shouldSupportInterfaces(['ERC721']);
|
||||||
|
|
||||||
describe('with minted tokens', function () {
|
describe('with minted tokens', function () {
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
|
|||||||
@ -14,5 +14,5 @@ describe('ERC165', function () {
|
|||||||
Object.assign(this, await loadFixture(fixture));
|
Object.assign(this, await loadFixture(fixture));
|
||||||
});
|
});
|
||||||
|
|
||||||
shouldSupportInterfaces(['ERC165']);
|
shouldSupportInterfaces();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -85,9 +85,11 @@ const SIGNATURES = {
|
|||||||
const INTERFACE_IDS = mapValues(SIGNATURES, interfaceId);
|
const INTERFACE_IDS = mapValues(SIGNATURES, interfaceId);
|
||||||
|
|
||||||
function shouldSupportInterfaces(interfaces = []) {
|
function shouldSupportInterfaces(interfaces = []) {
|
||||||
|
interfaces.unshift('ERC165');
|
||||||
|
|
||||||
describe('ERC165', function () {
|
describe('ERC165', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
this.contractUnderTest = this.mock || this.token || this.holder;
|
this.contractUnderTest = this.mock || this.token;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the interfaceId is supported', function () {
|
describe('when the interfaceId is supported', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user