Skip to content

Commit 68a5e1c

Browse files
authored
test: don't print constructors for Solc tests (#501)
1 parent 6a3a043 commit 68a5e1c

13 files changed

+2
-27
lines changed

crates/json-abi/tests/abi.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ fn to_sol_test(path: &str, abi: &JsonAbi, run_solc: bool) {
8080
let name = path.file_stem().unwrap().to_str().unwrap();
8181

8282
let mut abi = abi.clone();
83+
// Ignore constructors for Solc tests.
84+
abi.constructor = None;
8385
abi.dedup();
8486
let actual = abi.to_sol(name);
8587

@@ -110,9 +112,6 @@ fn to_sol_test(path: &str, abi: &JsonAbi, run_solc: bool) {
110112
Err(e) => panik(&format!("invalid JSON: {e}")),
111113
};
112114

113-
// Constructor is ignored.
114-
abi.constructor = None;
115-
116115
// Note that we don't compare the ABIs directly since the conversion is lossy, e.g.
117116
// `internalType` fields change.
118117
if solc_abi.len() != abi.len() {

crates/json-abi/tests/abi/AggregationRouterV5.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ interface AggregationRouterV5 {
8484
event OrderFilledRFQ(bytes32 orderHash, uint256 makingAmount);
8585
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
8686

87-
constructor(address weth);
88-
8987
receive() external payable;
9088

9189
function advanceNonce(uint8 amount) external;

crates/json-abi/tests/abi/BlurExchange.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ interface BlurExchange {
5252
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
5353
event Upgraded(address indexed implementation);
5454

55-
constructor();
56-
5755
function FEE_TYPEHASH() external view returns (bytes32);
5856
function INVERSE_BASIS_POINT() external view returns (uint256);
5957
function NAME() external view returns (string memory);

crates/json-abi/tests/abi/DoubleExponentInterestSetter.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
interface DoubleExponentInterestSetter {
2-
constructor((uint128, uint128) params);
3-
42
function getCoefficients() external view returns (uint256[] memory);
53
function getInterestRate(address, uint256 borrowWei, uint256 supplyWei) external view returns ((uint256,) memory);
64
function getMaxAPR() external view returns (uint256);

crates/json-abi/tests/abi/GaugeController.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ interface GaugeController {
77
event NewTypeWeight(int128 type_id, uint256 time, uint256 weight, uint256 total_weight);
88
event VoteForGauge(uint256 time, address user, address gauge_addr, uint256 weight);
99

10-
constructor(address _token, address _voting_escrow);
11-
1210
function add_gauge(address addr, int128 gauge_type, uint256 weight) external;
1311
function add_type(string memory _name, uint256 weight) external;
1412
function admin() external view returns (address);

crates/json-abi/tests/abi/GnosisSafe.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ interface GnosisSafe {
1414
event RemovedOwner(address owner);
1515
event SignMsg(bytes32 indexed msgHash);
1616

17-
constructor();
18-
1917
fallback() external payable;
2018

2119
function NAME() external view returns (string memory);

crates/json-abi/tests/abi/Junkyard.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ interface Junkyard {
1515
event PricesChange(uint256, uint256);
1616
event Unpaused(address account);
1717

18-
constructor(address[] jkdPayees, uint256[] jkdShares, address _gateway, address _gasReceiver);
19-
2018
receive() external payable;
2119

2220
function GAS_RECEIVER() external view returns (address);

crates/json-abi/tests/abi/LiquidityGaugeV4.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ interface LiquidityGaugeV4 {
88
event UpdateLiquidityLimit(address user, uint256 original_balance, uint256 original_supply, uint256 working_balance, uint256 working_supply);
99
event Withdraw(address indexed provider, uint256 value);
1010

11-
constructor();
12-
1311
function SDT() external view returns (address);
1412
function accept_transfer_ownership() external;
1513
function add_reward(address _reward_token, address _distributor) external;

crates/json-abi/tests/abi/Seaport.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ interface Seaport {
165165
event OrderValidated(bytes32 orderHash, OrderParameters orderParameters);
166166
event OrdersMatched(bytes32[] orderHashes);
167167

168-
constructor(address conduitController);
169-
170168
receive() external payable;
171169

172170
function cancel(OrderComponents[] memory orders) external returns (bool cancelled);

crates/json-abi/tests/abi/UniswapV2Factory.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
interface UniswapV2Factory {
22
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);
33

4-
constructor(address _feeToSetter);
5-
64
function allPairs(uint256) external view returns (address);
75
function allPairsLength() external view returns (uint256);
86
function createPair(address tokenA, address tokenB) external returns (address pair);

0 commit comments

Comments
 (0)