|
@@ -30,7 +30,17 @@ describe('Create2', function () {
|
|
|
|
|
|
it('should compute the correct contract address with deployer', async function () {
|
|
it('should compute the correct contract address with deployer', async function () {
|
|
const onChainComputed = await this.factory
|
|
const onChainComputed = await this.factory
|
|
- .computeAddress(saltHex, constructorByteCode, deployerAccount);
|
|
|
|
|
|
+ .methods['computeAddress(bytes32,bytes,address)'](saltHex, constructorByteCode, deployerAccount);
|
|
|
|
+ const offChainComputed =
|
|
|
|
+ computeCreate2Address(saltHex, constructorByteCode, deployerAccount);
|
|
|
|
+ expect(onChainComputed).to.equal(offChainComputed);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ it('should compute the correct contract address with deployer and bytecode hash', async function () {
|
|
|
|
+ const onChainComputed = await this.factory
|
|
|
|
+ .methods['computeAddress(bytes32,bytes32,address)'](
|
|
|
|
+ saltHex, web3.utils.keccak256(constructorByteCode), deployerAccount
|
|
|
|
+ );
|
|
const offChainComputed =
|
|
const offChainComputed =
|
|
computeCreate2Address(saltHex, constructorByteCode, deployerAccount);
|
|
computeCreate2Address(saltHex, constructorByteCode, deployerAccount);
|
|
expect(onChainComputed).to.equal(offChainComputed);
|
|
expect(onChainComputed).to.equal(offChainComputed);
|