ERC165.test.js 589 B

1234567891011121314151617181920
  1. const { contract } = require('@openzeppelin/test-environment');
  2. const { expectRevert } = require('@openzeppelin/test-helpers');
  3. const { shouldSupportInterfaces } = require('./SupportsInterface.behavior');
  4. const ERC165Mock = contract.fromArtifact('ERC165Mock');
  5. describe('ERC165', function () {
  6. beforeEach(async function () {
  7. this.mock = await ERC165Mock.new();
  8. });
  9. it('does not allow 0xffffffff', async function () {
  10. await expectRevert(this.mock.registerInterface('0xffffffff'), 'ERC165: invalid interface id');
  11. });
  12. shouldSupportInterfaces([
  13. 'ERC165',
  14. ]);
  15. });