Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Root Gauge Mocks #2546

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions pkg/liquidity-mining/contracts/test/MockAvalancheRootGauge.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;

import "../gauges/avalanche/AvalancheRootGauge.sol";

/**
* @dev This is used by the Avalanche Root Gauge deployment task in the deployments repo, and is referenced there.
* Do not delete.
*/
contract MockAvalancheRootGauge is AvalancheRootGauge {
constructor(IMainnetBalancerMinter minter, ILayerZeroBALProxy lzBALProxy) AvalancheRootGauge(minter, lzBALProxy) {
// solhint-disable-previous-line no-empty-blocks
}

/**
* @dev It would be very difficult to contrive a fork test that set the mintAmount to a precise value,
* so the bridge limits are best tested with a mock and unit tests.
* It must be payable to send ETH to pay for gas in the child chain.
* @param mintAmount Amount to be bridged
*/
function bridge(uint256 mintAmount) external payable {
_postMintAction(mintAmount);
}
}
42 changes: 42 additions & 0 deletions pkg/liquidity-mining/contracts/test/MockBaseRootGauge.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;

import "../gauges/base/BaseRootGauge.sol";

/**
* @dev This is used by the Base Root Gauge deployment task in the deployments repo, and is referenced there.
* Do not delete.
*/
contract MockBaseRootGauge is BaseRootGauge {
constructor(
IMainnetBalancerMinter minter,
IL1StandardBridge baseBridge,
address baseBAL
) BaseRootGauge(minter, baseBridge, baseBAL) {
// solhint-disable-previous-line no-empty-blocks
}

/**
* @dev It would be very difficult to contrive a fork test that set the mintAmount to a precise value,
* so the bridge limits are best tested with a mock and unit tests.
* It must be payable to send ETH to pay for gas in the child chain.
* @param mintAmount Amount to be bridged
*/
function bridge(uint256 mintAmount) external payable {
_postMintAction(mintAmount);
}
}
Loading