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

refactor: rename test contracts #174

Merged
merged 1 commit into from
Nov 14, 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
91 changes: 0 additions & 91 deletions contracts/test/InvalidInterchainToken.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BaseInterchainToken } from '../interchain-token/BaseInterchainToken.sol
import { Distributable } from '../utils/Distributable.sol';
import { IERC20MintableBurnable } from '../interfaces/IERC20MintableBurnable.sol';

contract BaseInterchainTokenTest is BaseInterchainToken, Distributable, IERC20MintableBurnable {
contract TestBaseInterchainToken is BaseInterchainToken, Distributable, IERC20MintableBurnable {
address public tokenManager_;
bool internal tokenManagerRequiresApproval_ = true;
string public name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BaseInterchainToken } from '../interchain-token/BaseInterchainToken.sol
import { Distributable } from '../utils/Distributable.sol';
import { IERC20MintableBurnable } from '../interfaces/IERC20MintableBurnable.sol';

contract FeeOnTransferTokenTest is BaseInterchainToken, Distributable, IERC20MintableBurnable {
contract TestFeeOnTransferToken is BaseInterchainToken, Distributable, IERC20MintableBurnable {
address public tokenManager_;
bool internal tokenManagerRequiresApproval_ = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@
pragma solidity ^0.8.0;

import { TokenManagerLiquidityPool } from '../token-manager/TokenManagerLiquidityPool.sol';
import { FlowLimit } from '../utils/FlowLimit.sol';
import { InterchainToken } from '../interchain-token/InterchainToken.sol';

error Invalid();

contract TestTokenManager is TokenManagerLiquidityPool {
contract TestTokenManagerLiquidityPool is TokenManagerLiquidityPool {
string public placeholder;

constructor(address interchainTokenService_) TokenManagerLiquidityPool(interchainTokenService_) {
if (LIQUIDITY_POOL_SLOT != uint256(keccak256('liquidity-pool-slot')) - 1) revert Invalid();
}
}

contract TestFlowLimit is FlowLimit {
string public placeholder;

constructor() {
if (FLOW_LIMIT_SLOT != uint256(keccak256('flow-limit')) - 1) revert Invalid();
if (LIQUIDITY_POOL_SLOT != bytes32(uint256(keccak256('liquidity-pool')) - 1)) revert Invalid();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
import { InterchainTokenExpressExecutable } from '../executable/InterchainTokenExpressExecutable.sol';
import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol';

contract InterchainExecutableTest is InterchainTokenExpressExecutable {
contract TestInterchainExecutable is InterchainTokenExpressExecutable {
event MessageReceived(string sourceChain, bytes sourceAddress, address receiver, string message, bytes32 tokenId, uint256 amount);

constructor(address interchainTokenService_) InterchainTokenExpressExecutable(interchainTokenService_) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import { InterchainTokenService } from '../InterchainTokenService.sol';

contract InterchainTokenServiceTest is InterchainTokenService {
contract TestInterchainTokenService is InterchainTokenService {
constructor(
address tokenManagerDeployer_,
address interchainTokenDeployer_,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { InterchainTokenExecutable } from '../executable/InterchainTokenExecutab
import { InterchainTokenExpressExecutable } from '../executable/InterchainTokenExpressExecutable.sol';
import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol';

contract InvalidInterchainExecutableTest is InterchainTokenExpressExecutable {
contract TestInvalidInterchainExecutable is InterchainTokenExpressExecutable {
bytes32 internal constant EXECUTE_FAILURE = keccak256('its-express-execute-failure');
bytes32 internal constant EXPRESS_EXECUTE_FAILURE = keccak256('its-express-execute-failure');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import { TokenManagerLockUnlock } from '../token-manager/TokenManagerLockUnlock.sol';

contract TokenManagerTest is TokenManagerLockUnlock {
contract TestTokenManager is TokenManagerLockUnlock {
constructor(address service) TokenManagerLockUnlock(service) {}

function addOperator(address operator) external {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import { TokenManagerProxy } from '../proxies/TokenManagerProxy.sol';

contract TokenManagerProxyTest is TokenManagerProxy {
contract TestTokenManagerProxy is TokenManagerProxy {
constructor(
address interchainTokenService_,
uint256 implementationType_,
Expand Down
33 changes: 0 additions & 33 deletions contracts/test/utils/NakedProxy.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import { Distributable } from '../../utils/Distributable.sol';

contract DistributableTest is Distributable {
contract TestDistributable is Distributable {
uint256 public nonce;

constructor(address distributor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ pragma solidity ^0.8.0;

import { FlowLimit } from '../../utils/FlowLimit.sol';

contract FlowLimitTest is FlowLimit {
contract TestFlowLimit is FlowLimit {
error Invalid();

bytes32 public constant TOKEN_ID = 0x0;

string public placeholder;

constructor() {
if (FLOW_LIMIT_SLOT != uint256(keccak256('flow-limit')) - 1) revert Invalid();
}

function setFlowLimit(uint256 flowLimit) external {
_setFlowLimit(flowLimit, TOKEN_ID);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import { IFlowLimit } from '../../interfaces/IFlowLimit.sol';

contract FlowLimitTestLiveNetwork is IFlowLimit {
contract TestFlowLimitLiveNetwork is IFlowLimit {
uint256 internal constant FLOW_LIMIT_SLOT = 0x201b7a0b7c19aaddc4ce9579b7df8d2db123805861bc7763627f13e04d8af42f;
uint256 internal constant PREFIX_FLOW_OUT_AMOUNT = uint256(keccak256('flow-out-amount'));
uint256 internal constant PREFIX_FLOW_IN_AMOUNT = uint256(keccak256('flow-in-amount'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import { Operatable } from '../../utils/Operatable.sol';

contract OperatableTest is Operatable {
contract TestOperatable is Operatable {
uint256 public nonce;

constructor(address operator) {
Expand Down
4 changes: 2 additions & 2 deletions contracts/token-manager/TokenManagerLiquidityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ contract TokenManagerLiquidityPool is TokenManager, ReentrancyGuard, ITokenManag

error NotSupported();

// uint256(keccak256('liquidity-pool-slot')) - 1
uint256 internal constant LIQUIDITY_POOL_SLOT = 0x8e02741a3381812d092c5689c9fc701c5185c1742fdf7954c4c4472be4cc4807;
// bytes32(uint256(keccak256('liquidity-pool')) - 1);
bytes32 internal constant LIQUIDITY_POOL_SLOT = 0x6b96d20becbf90996c525d678f980ffe6dec77fdb9e37d175b3726d4dcebc2c1;

/**
* @dev Constructs an instance of TokenManagerLiquidityPool. Calls the constructor
Expand Down
2 changes: 1 addition & 1 deletion contracts/token-manager/TokenManagerLockUnlock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol';
import { SafeTokenTransfer, SafeTokenTransferFrom, SafeTokenCall } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeTransfer.sol';

import { ITokenManagerLockUnlock } from '..//interfaces/ITokenManagerLockUnlock.sol';
import { ITokenManagerLockUnlock } from '../interfaces/ITokenManagerLockUnlock.sol';
import { TokenManager } from './TokenManager.sol';

/**
Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3310,7 +3310,7 @@ _Returns the implementation address from the interchain token service for the pr
| ---- | ---- | ----------- |
| implementation_ | address | The address of the implementation |

## FeeOnTransferTokenTest
## TestFeeOnTransferToken

### tokenManager_

Expand Down Expand Up @@ -3475,7 +3475,7 @@ string NAME
constructor() public
```

## InterchainExecutableTest
## TestInterchainExecutable

### MessageReceived

Expand All @@ -3501,7 +3501,7 @@ string lastMessage
function _executeWithInterchainToken(string sourceChain, bytes sourceAddress, bytes data, bytes32 tokenId, address token, uint256 amount) internal
```

## BaseInterchainTokenTest
## TestBaseInterchainToken

### tokenManager_

Expand Down Expand Up @@ -3585,7 +3585,7 @@ function burn(address account, uint256 amount) external
function setTokenManager(address tokenManagerAddress) external
```

## DistributableTest
## TestDistributable

### nonce

Expand All @@ -3611,7 +3611,7 @@ function testDistributable() external
function distributorRole() external pure returns (uint8)
```

## FlowLimitTest
## TestFlowLimit

### TOKEN_ID

Expand All @@ -3637,7 +3637,7 @@ function addFlowIn(uint256 flowInAmount) external
function addFlowOut(uint256 flowOutAmount) external
```

## FlowLimitTestLiveNetwork
## TestFlowLimitLiveNetwork

### FLOW_LIMIT_SLOT

Expand Down Expand Up @@ -3791,7 +3791,7 @@ fallback() external payable virtual
receive() external payable virtual
```

## OperatableTest
## TestOperatable

### nonce

Expand Down
2 changes: 1 addition & 1 deletion test/InterchainTokenFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('InterchainTokenFactory', () => {
const tokenCap = BigInt(1e18);

async function deployToken() {
token = await deployContract(wallet, 'BaseInterchainTokenTest', [name, symbol, decimals, wallet.address]);
token = await deployContract(wallet, 'TestBaseInterchainToken', [name, symbol, decimals, wallet.address]);
tokenId = await tokenFactory.canonicalInterchainTokenId(token.address);
tokenManagerAddress = await service.tokenManagerAddress(tokenId);
await (await token.mint(wallet.address, tokenCap)).wait();
Expand Down
Loading
Loading