Skip to content

Commit

Permalink
separate inheritance test contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Dec 30, 2022
1 parent d914fd8 commit 54de54d
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 100 deletions.
26 changes: 26 additions & 0 deletions contracts/Inheritance.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

abstract contract Parent1 {
constructor(uint x) {}

function _testParent1() internal {}
}

abstract contract Parent2 {
constructor(uint y) {}
}

abstract contract Parent3 {
constructor(uint z) {}
}

abstract contract Child1 is Parent1 {}

abstract contract Child2 is Parent1, Parent2 {}

abstract contract Child3 is Parent1, Parent2, Child2 {}

abstract contract Child4 is Parent1, Parent2, Parent3 {
constructor(uint c) {}
}
24 changes: 0 additions & 24 deletions contracts/Test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,30 +118,6 @@ contract Concrete2 is Abs {
uint public override abs = 42;
}

abstract contract Parent1 {
constructor(uint x) {}

function _testParent1() internal {}
}

abstract contract Parent2 {
constructor(uint y) {}
}

abstract contract Parent3 {
constructor(uint z) {}
}

abstract contract Child1 is Parent1 {}

abstract contract Child2 is Parent1, Parent2 {}

abstract contract Child3 is Parent1, Parent2, Child2 {}

abstract contract Child4 is Parent1, Parent2, Parent3 {
constructor(uint c) {}
}

contract Types {
enum Enum {
A
Expand Down
161 changes: 85 additions & 76 deletions src/core.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,91 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 4
`// SPDX-License-Identifier: UNLICENSED␊
pragma solidity >=0.6.0;␊
import "../contracts/Inheritance.sol";␊
contract $Parent1 is Parent1 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x) Parent1(x) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Parent2 is Parent2 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 y) Parent2(y) {}␊
receive() external payable {}␊
}␊
contract $Parent3 is Parent3 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 z) Parent3(z) {}␊
receive() external payable {}␊
}␊
contract $Child1 is Child1 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x) Parent1(x) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Child2 is Child2 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Child3 is Child3 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Child4 is Child4 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x, uint256 y, uint256 z, uint256 c) Parent1(x) Parent2(y) Parent3(z) Child4(c) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
`

> Snapshot 5
`// SPDX-License-Identifier: UNLICENSED␊
pragma solidity >=0.6.0;␊
Expand Down Expand Up @@ -292,82 +377,6 @@ Generated by [AVA](https://avajs.dev).
receive() external payable {}␊
}␊
contract $Parent1 is Parent1 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x) Parent1(x) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Parent2 is Parent2 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 y) Parent2(y) {}␊
receive() external payable {}␊
}␊
contract $Parent3 is Parent3 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 z) Parent3(z) {}␊
receive() external payable {}␊
}␊
contract $Child1 is Child1 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x) Parent1(x) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Child2 is Child2 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Child3 is Child3 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Child4 is Child4 {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
constructor(uint256 x, uint256 y, uint256 z, uint256 c) Parent1(x) Parent2(y) Parent3(z) Child4(c) {}␊
function $_testParent1() external {␊
super._testParent1();␊
}␊
receive() external payable {}␊
}␊
contract $Types is Types {␊
bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊
Expand Down
Binary file modified src/core.test.ts.snap
Binary file not shown.

0 comments on commit 54de54d

Please sign in to comment.