Use Prettier for JS files (#3913)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -6,7 +6,7 @@ const { expect } = require('chai');
|
||||
const ERC1820Implementer = artifacts.require('$ERC1820Implementer');
|
||||
|
||||
contract('ERC1820Implementer', function (accounts) {
|
||||
const [ registryFunder, implementee, other ] = accounts;
|
||||
const [registryFunder, implementee, other] = accounts;
|
||||
|
||||
const ERC1820_ACCEPT_MAGIC = bufferToHex(keccakFromString('ERC1820_ACCEPT_MAGIC'));
|
||||
|
||||
@ -20,15 +20,16 @@ contract('ERC1820Implementer', function (accounts) {
|
||||
|
||||
context('with no registered interfaces', function () {
|
||||
it('returns false when interface implementation is queried', async function () {
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceA, implementee))
|
||||
.to.not.equal(ERC1820_ACCEPT_MAGIC);
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceA, implementee)).to.not.equal(
|
||||
ERC1820_ACCEPT_MAGIC,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts when attempting to set as implementer in the registry', async function () {
|
||||
await expectRevert(
|
||||
this.registry.setInterfaceImplementer(
|
||||
implementee, this.interfaceA, this.implementer.address, { from: implementee },
|
||||
),
|
||||
this.registry.setInterfaceImplementer(implementee, this.interfaceA, this.implementer.address, {
|
||||
from: implementee,
|
||||
}),
|
||||
'Does not implement the interface',
|
||||
);
|
||||
});
|
||||
@ -40,27 +41,31 @@ contract('ERC1820Implementer', function (accounts) {
|
||||
});
|
||||
|
||||
it('returns true when interface implementation is queried', async function () {
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceA, implementee))
|
||||
.to.equal(ERC1820_ACCEPT_MAGIC);
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceA, implementee)).to.equal(
|
||||
ERC1820_ACCEPT_MAGIC,
|
||||
);
|
||||
});
|
||||
|
||||
it('returns false when interface implementation for non-supported interfaces is queried', async function () {
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceB, implementee))
|
||||
.to.not.equal(ERC1820_ACCEPT_MAGIC);
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceB, implementee)).to.not.equal(
|
||||
ERC1820_ACCEPT_MAGIC,
|
||||
);
|
||||
});
|
||||
|
||||
it('returns false when interface implementation for non-supported addresses is queried', async function () {
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceA, other))
|
||||
.to.not.equal(ERC1820_ACCEPT_MAGIC);
|
||||
expect(await this.implementer.canImplementInterfaceForAddress(this.interfaceA, other)).to.not.equal(
|
||||
ERC1820_ACCEPT_MAGIC,
|
||||
);
|
||||
});
|
||||
|
||||
it('can be set as an implementer for supported interfaces in the registry', async function () {
|
||||
await this.registry.setInterfaceImplementer(
|
||||
implementee, this.interfaceA, this.implementer.address, { from: implementee },
|
||||
);
|
||||
await this.registry.setInterfaceImplementer(implementee, this.interfaceA, this.implementer.address, {
|
||||
from: implementee,
|
||||
});
|
||||
|
||||
expect(await this.registry.getInterfaceImplementer(implementee, this.interfaceA))
|
||||
.to.equal(this.implementer.address);
|
||||
expect(await this.registry.getInterfaceImplementer(implementee, this.interfaceA)).to.equal(
|
||||
this.implementer.address,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user