Commit 696acab6 by Francisco Giordano

rename Impl contracts to Mock

parent 9efc0a88
...@@ -2,7 +2,7 @@ pragma solidity ^0.6.0; ...@@ -2,7 +2,7 @@ pragma solidity ^0.6.0;
import "../utils/Address.sol"; import "../utils/Address.sol";
contract AddressImpl { contract AddressMock {
function isContract(address account) external view returns (bool) { function isContract(address account) external view returns (bool) {
return Address.isContract(account); return Address.isContract(account);
} }
......
...@@ -2,7 +2,7 @@ pragma solidity ^0.6.0; ...@@ -2,7 +2,7 @@ pragma solidity ^0.6.0;
import "../utils/Arrays.sol"; import "../utils/Arrays.sol";
contract ArraysImpl { contract ArraysMock {
using Arrays for uint256[]; using Arrays for uint256[];
uint256[] private _array; uint256[] private _array;
......
...@@ -2,7 +2,7 @@ pragma solidity ^0.6.0; ...@@ -2,7 +2,7 @@ pragma solidity ^0.6.0;
import "../utils/Counters.sol"; import "../utils/Counters.sol";
contract CountersImpl { contract CountersMock {
using Counters for Counters.Counter; using Counters for Counters.Counter;
Counters.Counter private _counter; Counters.Counter private _counter;
......
...@@ -3,7 +3,7 @@ pragma solidity ^0.6.0; ...@@ -3,7 +3,7 @@ pragma solidity ^0.6.0;
import "../utils/Create2.sol"; import "../utils/Create2.sol";
import "../introspection/ERC1820Implementer.sol"; import "../introspection/ERC1820Implementer.sol";
contract Create2Impl { contract Create2Mock {
function deploy(uint256 value, bytes32 salt, bytes memory code) public { function deploy(uint256 value, bytes32 salt, bytes memory code) public {
Create2.deploy(value, salt, code); Create2.deploy(value, salt, code);
} }
......
...@@ -3,14 +3,14 @@ const { accounts, contract } = require('@openzeppelin/test-environment'); ...@@ -3,14 +3,14 @@ const { accounts, contract } = require('@openzeppelin/test-environment');
const { balance, ether, expectRevert, send } = require('@openzeppelin/test-helpers'); const { balance, ether, expectRevert, send } = require('@openzeppelin/test-helpers');
const { expect } = require('chai'); const { expect } = require('chai');
const AddressImpl = contract.fromArtifact('AddressImpl'); const AddressMock = contract.fromArtifact('AddressMock');
const EtherReceiver = contract.fromArtifact('EtherReceiverMock'); const EtherReceiver = contract.fromArtifact('EtherReceiverMock');
describe('Address', function () { describe('Address', function () {
const [ recipient, other ] = accounts; const [ recipient, other ] = accounts;
beforeEach(async function () { beforeEach(async function () {
this.mock = await AddressImpl.new(); this.mock = await AddressMock.new();
}); });
describe('isContract', function () { describe('isContract', function () {
...@@ -19,7 +19,7 @@ describe('Address', function () { ...@@ -19,7 +19,7 @@ describe('Address', function () {
}); });
it('should return true for contract address', async function () { it('should return true for contract address', async function () {
const contract = await AddressImpl.new(); const contract = await AddressMock.new();
expect(await this.mock.isContract(contract.address)).to.equal(true); expect(await this.mock.isContract(contract.address)).to.equal(true);
}); });
}); });
......
...@@ -3,14 +3,14 @@ require('@openzeppelin/test-helpers'); ...@@ -3,14 +3,14 @@ require('@openzeppelin/test-helpers');
const { expect } = require('chai'); const { expect } = require('chai');
const ArraysImpl = contract.fromArtifact('ArraysImpl'); const ArraysMock = contract.fromArtifact('ArraysMock');
describe('Arrays', function () { describe('Arrays', function () {
context('Even number of elements', function () { context('Even number of elements', function () {
const EVEN_ELEMENTS_ARRAY = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]; const EVEN_ELEMENTS_ARRAY = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
beforeEach(async function () { beforeEach(async function () {
this.arrays = await ArraysImpl.new(EVEN_ELEMENTS_ARRAY); this.arrays = await ArraysMock.new(EVEN_ELEMENTS_ARRAY);
}); });
it('should return correct index for the basic case', async function () { it('should return correct index for the basic case', async function () {
...@@ -38,7 +38,7 @@ describe('Arrays', function () { ...@@ -38,7 +38,7 @@ describe('Arrays', function () {
const ODD_ELEMENTS_ARRAY = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]; const ODD_ELEMENTS_ARRAY = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21];
beforeEach(async function () { beforeEach(async function () {
this.arrays = await ArraysImpl.new(ODD_ELEMENTS_ARRAY); this.arrays = await ArraysMock.new(ODD_ELEMENTS_ARRAY);
}); });
it('should return correct index for the basic case', async function () { it('should return correct index for the basic case', async function () {
...@@ -66,7 +66,7 @@ describe('Arrays', function () { ...@@ -66,7 +66,7 @@ describe('Arrays', function () {
const WITH_GAP_ARRAY = [11, 12, 13, 14, 15, 20, 21, 22, 23, 24]; const WITH_GAP_ARRAY = [11, 12, 13, 14, 15, 20, 21, 22, 23, 24];
beforeEach(async function () { beforeEach(async function () {
this.arrays = await ArraysImpl.new(WITH_GAP_ARRAY); this.arrays = await ArraysMock.new(WITH_GAP_ARRAY);
}); });
it('should return index of first element in next filled range', async function () { it('should return index of first element in next filled range', async function () {
...@@ -76,7 +76,7 @@ describe('Arrays', function () { ...@@ -76,7 +76,7 @@ describe('Arrays', function () {
context('Empty array', function () { context('Empty array', function () {
beforeEach(async function () { beforeEach(async function () {
this.arrays = await ArraysImpl.new([]); this.arrays = await ArraysMock.new([]);
}); });
it('should always return 0 for empty array', async function () { it('should always return 0 for empty array', async function () {
......
...@@ -3,11 +3,11 @@ const { expectRevert } = require('@openzeppelin/test-helpers'); ...@@ -3,11 +3,11 @@ const { expectRevert } = require('@openzeppelin/test-helpers');
const { expect } = require('chai'); const { expect } = require('chai');
const CountersImpl = contract.fromArtifact('CountersImpl'); const CountersMock = contract.fromArtifact('CountersMock');
describe('Counters', function () { describe('Counters', function () {
beforeEach(async function () { beforeEach(async function () {
this.counter = await CountersImpl.new(); this.counter = await CountersMock.new();
}); });
it('starts at zero', async function () { it('starts at zero', async function () {
......
...@@ -3,7 +3,7 @@ const { balance, BN, ether, expectRevert, send } = require('@openzeppelin/test-h ...@@ -3,7 +3,7 @@ const { balance, BN, ether, expectRevert, send } = require('@openzeppelin/test-h
const { expect } = require('chai'); const { expect } = require('chai');
const Create2Impl = contract.fromArtifact('Create2Impl'); const Create2Mock = contract.fromArtifact('Create2Mock');
const ERC20Mock = contract.fromArtifact('ERC20Mock'); const ERC20Mock = contract.fromArtifact('ERC20Mock');
const ERC1820Implementer = contract.fromArtifact('ERC1820Implementer'); const ERC1820Implementer = contract.fromArtifact('ERC1820Implementer');
...@@ -21,7 +21,7 @@ describe('Create2', function () { ...@@ -21,7 +21,7 @@ describe('Create2', function () {
const constructorByteCode = `${ERC20Mock.bytecode}${encodedParams}`; const constructorByteCode = `${ERC20Mock.bytecode}${encodedParams}`;
beforeEach(async function () { beforeEach(async function () {
this.factory = await Create2Impl.new(); this.factory = await Create2Mock.new();
}); });
it('should compute the correct contract address', async function () { it('should compute the correct contract address', async function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment