-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: initialize constructor unit test
- Loading branch information
Showing
3 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import './TestGhoBase.t.sol'; | ||
|
||
contract TestGsmConverter is TestGhoBase { | ||
// using PercentageMath for uint256; | ||
// using PercentageMath for uint128; | ||
|
||
function setUp() public { | ||
// (gsmSignerAddr, gsmSignerKey) = makeAddrAndKey('gsmSigner'); | ||
} | ||
|
||
function testConstructor() public { | ||
GsmConverter gsmConverter = new GsmConverter( | ||
address(GHO_GSM), | ||
address(REDEMPTION), | ||
address(BUIDL_TOKEN), | ||
address(USDC_TOKEN) | ||
); | ||
assertEq(gsmConverter.GSM(), address(GHO_GSM), 'Unexpected GSM address'); | ||
assertEq( | ||
gsmConverter.REDEMPTION_CONTRACT(), | ||
address(REDEMPTION), | ||
'Unexpected redemption contract address' | ||
); | ||
assertEq( | ||
gsmConverter.REDEEMABLE_ASSET(), | ||
address(BUIDL_TOKEN), | ||
'Unexpected redeemable asset address' | ||
); | ||
assertEq( | ||
gsmConverter.REDEEMED_ASSET(), | ||
address(USDC_TOKEN), | ||
'Unexpected redeemed asset address' | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Copyright 2024 Circle Internet Financial, LTD. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
pragma solidity ^0.8.10; | ||
|
||
import {IRedemption} from '../../contracts/facilitators/gsm/dependencies/circle/IRedemption.sol'; | ||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; | ||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; | ||
|
||
/** | ||
* @title MockRedemption | ||
* @dev Asset token is ERC20-compatible | ||
* @dev Liquidity token is ERC20-compatible | ||
*/ | ||
contract MockRedemption is IRedemption { | ||
using SafeERC20 for IERC20; | ||
|
||
/** | ||
* @inheritdoc IRedemption | ||
*/ | ||
address public immutable asset; | ||
|
||
/** | ||
* @inheritdoc IRedemption | ||
*/ | ||
address public immutable liquidity; | ||
|
||
/** | ||
* @param _asset Address of asset token | ||
* @param _liquidity Address of liquidity token | ||
*/ | ||
constructor(address _asset, address _liquidity) { | ||
asset = _asset; | ||
liquidity = _liquidity; | ||
} | ||
|
||
function test_coverage_ignore() public virtual { | ||
// Intentionally left blank. | ||
// Excludes contract from coverage. | ||
} | ||
|
||
/** | ||
* @inheritdoc IRedemption | ||
*/ | ||
function redeem(uint256 amount) external { | ||
// Intentionally left blank. | ||
} | ||
} |