From 54de54d13272ffcf1b1168a8c256c946d9c14cfe Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Fri, 30 Dec 2022 17:58:17 -0300 Subject: [PATCH] separate inheritance test contracts --- contracts/Inheritance.sol | 26 ++++++ contracts/Test.sol | 24 ------ src/core.test.ts.md | 161 ++++++++++++++++++++------------------ src/core.test.ts.snap | Bin 1545 -> 1566 bytes 4 files changed, 111 insertions(+), 100 deletions(-) create mode 100644 contracts/Inheritance.sol diff --git a/contracts/Inheritance.sol b/contracts/Inheritance.sol new file mode 100644 index 0000000..6ae2357 --- /dev/null +++ b/contracts/Inheritance.sol @@ -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) {} +} diff --git a/contracts/Test.sol b/contracts/Test.sol index 2cde8a0..1136fb2 100644 --- a/contracts/Test.sol +++ b/contracts/Test.sol @@ -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 diff --git a/src/core.test.ts.md b/src/core.test.ts.md index 7194a6e..5bf1c20 100644 --- a/src/core.test.ts.md +++ b/src/core.test.ts.md @@ -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;␊ @@ -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";␊ ␊ diff --git a/src/core.test.ts.snap b/src/core.test.ts.snap index 8fb71bcc9e0cd0b83042e23115492730f61e43c5..4efaea4bb56374ffa69a32b0b5fda0f5e6061e4a 100644 GIT binary patch literal 1566 zcmV+(2I2WZRzV=V zi%{gu7-H?*G~-DVR{PM0{*di2t?jwQlNrw?FiBR02jbYr=X~d!&pwW4zTEb7Oa18n z{VyVz=&0|S(02P4!C}Mw=ZmI60{>k8@tdWUCHA-c?b7$pzFXef0-f_We{7y&6`3yD zY-`9Q_!cAQC3t^!+CFKWby{y~HQRxA1_Z99V-1rLcy+Yh*l%nf)@sBMq^90 zOyWS5xLd8Es(TvJ8g#-c6$(edS~vo*3!?U?8lZo@5kYQK0k+rEu?o7~e!q)`w&fzN z%f?hoLtO(pACUu&z-k{lS|5_lK!llLTBs?PIG#!@r@jt8efE1Dq#`^(v>~#gXsRelnsew-BReb+VY8|&{M7_yHwwz`OoK9R-jAEAEL6gd;A5?;bBbS3 zQrDixO6m`56_wOW3be?XK3Q+yS{6$!`*_T}8ql_}c^BpM=oRR!1Ny~})!LxjkxNoA zjSq2Y+SUC~@F?YqSs7sT7tI#&9Mc8$4ls~mIc!x$x%LNv8_Vxln-L*{&fT_Db0CzW z*tljBZzSrw!yP$Xxl%e!s!)ls(sNKTg^E;Rb2^1hslwgqT;7!_Wb2eNBo`*@*cMgS z{f;AX!E;4fmO8{?gq0d|`FOyzLMB6vIaVp<!8`QMBeqBK7gh=D z6PgP{X`4(w%qXb10HAQ|W|=C@4f1cOqc01IQ4ujN*rUD6k&SqU z{YJ$FC8aAoxW-FOAlMB?qt7x=3tOgVFt6&|wFdhNP+onGCZX)w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