Skip to content

Commit

Permalink
test: don't print constructors for Solc tests (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jan 25, 2024
1 parent 6a3a043 commit 68a5e1c
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 27 deletions.
5 changes: 2 additions & 3 deletions crates/json-abi/tests/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ fn to_sol_test(path: &str, abi: &JsonAbi, run_solc: bool) {
let name = path.file_stem().unwrap().to_str().unwrap();

let mut abi = abi.clone();
// Ignore constructors for Solc tests.
abi.constructor = None;
abi.dedup();
let actual = abi.to_sol(name);

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

// Constructor is ignored.
abi.constructor = None;

// Note that we don't compare the ABIs directly since the conversion is lossy, e.g.
// `internalType` fields change.
if solc_abi.len() != abi.len() {
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/AggregationRouterV5.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ interface AggregationRouterV5 {
event OrderFilledRFQ(bytes32 orderHash, uint256 makingAmount);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

constructor(address weth);

receive() external payable;

function advanceNonce(uint8 amount) external;
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/BlurExchange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ interface BlurExchange {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event Upgraded(address indexed implementation);

constructor();

function FEE_TYPEHASH() external view returns (bytes32);
function INVERSE_BASIS_POINT() external view returns (uint256);
function NAME() external view returns (string memory);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/DoubleExponentInterestSetter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
interface DoubleExponentInterestSetter {
constructor((uint128, uint128) params);

function getCoefficients() external view returns (uint256[] memory);
function getInterestRate(address, uint256 borrowWei, uint256 supplyWei) external view returns ((uint256,) memory);
function getMaxAPR() external view returns (uint256);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/GaugeController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ interface GaugeController {
event NewTypeWeight(int128 type_id, uint256 time, uint256 weight, uint256 total_weight);
event VoteForGauge(uint256 time, address user, address gauge_addr, uint256 weight);

constructor(address _token, address _voting_escrow);

function add_gauge(address addr, int128 gauge_type, uint256 weight) external;
function add_type(string memory _name, uint256 weight) external;
function admin() external view returns (address);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/GnosisSafe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ interface GnosisSafe {
event RemovedOwner(address owner);
event SignMsg(bytes32 indexed msgHash);

constructor();

fallback() external payable;

function NAME() external view returns (string memory);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/Junkyard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ interface Junkyard {
event PricesChange(uint256, uint256);
event Unpaused(address account);

constructor(address[] jkdPayees, uint256[] jkdShares, address _gateway, address _gasReceiver);

receive() external payable;

function GAS_RECEIVER() external view returns (address);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/LiquidityGaugeV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ interface LiquidityGaugeV4 {
event UpdateLiquidityLimit(address user, uint256 original_balance, uint256 original_supply, uint256 working_balance, uint256 working_supply);
event Withdraw(address indexed provider, uint256 value);

constructor();

function SDT() external view returns (address);
function accept_transfer_ownership() external;
function add_reward(address _reward_token, address _distributor) external;
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/Seaport.sol
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ interface Seaport {
event OrderValidated(bytes32 orderHash, OrderParameters orderParameters);
event OrdersMatched(bytes32[] orderHashes);

constructor(address conduitController);

receive() external payable;

function cancel(OrderComponents[] memory orders) external returns (bool cancelled);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/UniswapV2Factory.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
interface UniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);

constructor(address _feeToSetter);

function allPairs(uint256) external view returns (address);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB) external returns (address pair);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/UniswapV2FactoryWithMigrator.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
interface UniswapV2FactoryWithMigrator {
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);

constructor(address _feeToSetter);

function allPairs(uint256) external view returns (address);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB) external returns (address pair);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/ZRXToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ interface ZRXToken {
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint256 _value);

constructor();

function allowance(address _owner, address _spender) external returns (uint256);
function approve(address _spender, uint256 _value) external returns (bool);
function balanceOf(address _owner) external returns (uint256);
Expand Down
2 changes: 0 additions & 2 deletions crates/json-abi/tests/abi/ZeroXExchange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ interface ZeroXExchange {
event Fill(address indexed makerAddress, address indexed feeRecipientAddress, address takerAddress, address senderAddress, uint256 makerAssetFilledAmount, uint256 takerAssetFilledAmount, uint256 makerFeePaid, uint256 takerFeePaid, bytes32 indexed orderHash, bytes makerAssetData, bytes takerAssetData);
event SignatureValidatorApproval(address indexed signerAddress, address indexed validatorAddress, bool approved);

constructor(bytes _zrxAssetData);

function EIP712_DOMAIN_HASH() external view returns (bytes32);
function VERSION() external view returns (string memory);
function ZRX_ASSET_DATA() external view returns (bytes memory);
Expand Down

0 comments on commit 68a5e1c

Please sign in to comment.