Skip to content
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
41 changes: 27 additions & 14 deletions packages/contracts-bedrock/test/L2/LiquidityController.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,39 @@ contract LiquidityController_TestInit is CommonTest {
skipIfDevFeatureDisabled(DevFeatures.CUSTOM_GAS_TOKEN);
}

/// @notice Tests that contract version is set correctly.
function test_setup_version_succeeds() public view {
assertTrue(bytes(liquidityController.version()).length > 0);
/// @notice Helper function to authorize a minter.
function _authorizeMinter(address _minter) internal {
// Authorize the minter
stdstore.target(address(liquidityController)).sig(liquidityController.minters.selector).with_key(_minter)
.checked_write(true);
}
}

/// @notice Tests that gas paying token name is set correctly.
function test_setup_gasPayingTokenName_succeeds() public view {
assertTrue(bytes(liquidityController.gasPayingTokenName()).length > 0);
/// @title LiquidityController_Version_Test
/// @notice Tests the `version` function of the `LiquidityController` contract.
contract LiquidityController_Version_Test is LiquidityController_TestInit {
/// @notice Tests that the version function returns a valid string.
function test_version_succeeds() public view {
assert(bytes(liquidityController.version()).length > 0);
}
}

/// @notice Tests that gas paying token symbol is set correctly.
function test_setup_gasPayingTokenSymbol_succeeds() public view {
assertTrue(bytes(liquidityController.gasPayingTokenSymbol()).length > 0);
/// @title LiquidityController_GasPayingTokenName_Test
/// @notice Tests the `gasPayingTokenName` function of the `LiquidityController` contract.
contract LiquidityController_GasPayingTokenName_Test is LiquidityController_TestInit {
/// @notice Tests that the `version` function returns the correct string. We avoid testing the
/// specific value of the string as it changes frequently.
function test_gasPayingTokenName_succeeds() public view {
assertTrue(bytes(liquidityController.gasPayingTokenName()).length > 0);
}
}

/// @notice Helper function to authorize a minter.
function _authorizeMinter(address _minter) internal {
// Authorize the minter
stdstore.target(address(liquidityController)).sig(liquidityController.minters.selector).with_key(_minter)
.checked_write(true);
/// @title LiquidityController_GasPayingTokenSymbol_Test
/// @notice Tests the `gasPayingTokenSymbol` function of the `LiquidityController` contract.
contract LiquidityController_GasPayingTokenSymbol_Test is LiquidityController_TestInit {
/// @notice Tests that the gasPayingTokenSymbol function returns a valid string.
function test_gasPayingTokenSymbol_succeeds() public view {
assertTrue(bytes(liquidityController.gasPayingTokenSymbol()).length > 0);
}
}

Expand Down
12 changes: 8 additions & 4 deletions packages/contracts-bedrock/test/L2/NativeAssetLiquidity.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ contract NativeAssetLiquidity_TestInit is CommonTest {
super.setUp();
skipIfDevFeatureDisabled(DevFeatures.CUSTOM_GAS_TOKEN);
}
}

/// @notice Tests that contract is set up correctly.
function test_setup_version_succeeds() public view {
// Assert
assertTrue(bytes(nativeAssetLiquidity.version()).length > 0);
/// @title NativeAssetLiquidity_Version_Test
/// @notice Tests the `version` function of the `NativeAssetLiquidity` contract.
contract NativeAssetLiquidity_Version_Test is NativeAssetLiquidity_TestInit {
/// @notice Tests that the `version` function returns the correct string. We avoid testing the
/// specific value of the string as it changes frequently.
function test_version_succeeds() public view {
assert(bytes(nativeAssetLiquidity.version()).length > 0);
}
}

Expand Down