Skip to content

Commit

Permalink
refactor: update integration test deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Sep 11, 2023
1 parent 9ca437a commit 7f4edaa
Show file tree
Hide file tree
Showing 24 changed files with 1,040 additions and 130 deletions.
3 changes: 3 additions & 0 deletions copy_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
rm -rf ./contracts
mkdir -p ./contracts/isolated-pools
cp -rf ./node_modules/@venusprotocol/isolated-pools/contracts/ ./contracts/isolated-pools/contracts
rm -rf contracts/isolated-pools/contracts/test

mkdir -p ./contracts/oracle
cp -rf ./node_modules/@venusprotocol/oracle/contracts/ ./contracts/oracle/contracts
rm -rf contracts/oracle/contracts/test

mkdir -p ./contracts/protocol
cp -rf ./node_modules/@venusprotocol/venus-protocol/contracts/ ./contracts/protocol/contracts
rm -rf contracts/protocol/contracts/test

mkdir -p ./contracts/mocks
cp -rf ./mocks/ ./contracts/mocks/contracts
2 changes: 1 addition & 1 deletion deploy/001-deploy-mock-tokens.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deployMockTokens from '@venusprotocol/isolated-pools/deploy/001-deploy-mock-tokens';
import deployMockTokens from '@venusprotocol/isolated-pools/dist/deploy/001-deploy-mock-tokens';

deployMockTokens.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
2 changes: 1 addition & 1 deletion deploy/002-deploy-oracles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deployOracle from '@venusprotocol/oracle/deploy/1-deploy-oracles';
import deployOracle from '@venusprotocol/oracle/dist/deploy/1-deploy-oracles';

deployOracle.skip = async () => process.env.PACKAGE == 'venus-governance';

Expand Down
2 changes: 1 addition & 1 deletion deploy/003-configure-feeds.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import configureFeeds from '@venusprotocol/oracle/deploy/2-configure-feeds';
import configureFeeds from '@venusprotocol/oracle/dist/deploy/2-configure-feeds';

configureFeeds.skip = async () => process.env.PACKAGE == 'venus-governance';

Expand Down
2 changes: 1 addition & 1 deletion deploy/004-swap-router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deployPoolLens from '@venusprotocol/isolated-pools/deploy/004-swap-router';
import deployPoolLens from '@venusprotocol/isolated-pools/dist/deploy/004-swap-router';

deployPoolLens.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
2 changes: 1 addition & 1 deletion deploy/005-access-control.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import accessControl from '@venusprotocol/isolated-pools/deploy/005-access-control';
import accessControl from '@venusprotocol/isolated-pools/dist/deploy/005-access-control';

accessControl.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deployPoolLens from '@venusprotocol/isolated-pools/deploy/009-deploy-pool-lens';
import deployPoolLens from '@venusprotocol/isolated-pools/dist/deploy/006-deploy-pool-registry';

deployPoolLens.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
78 changes: 0 additions & 78 deletions deploy/006-riskfund-protocolshare.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deployPoolLens from '@venusprotocol/isolated-pools/deploy/007-deploy-factories';
import deployPoolLens from '@venusprotocol/isolated-pools/dist/deploy/007-deploy-pool-lens';

deployPoolLens.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import accessControlConfigure from '@venusprotocol/isolated-pools/deploy/008-access-control-configure';
import accessControlConfigure from '@venusprotocol/isolated-pools/dist/deploy/008-deploy-comptrollers';

accessControlConfigure.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deployPoolLens from '@venusprotocol/isolated-pools/deploy/010-deploy-pools';
import deployPoolLens from '@venusprotocol/isolated-pools/dist/deploy/009-deploy-vtokens';

deployPoolLens.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
5 changes: 5 additions & 0 deletions deploy/010-deploy-reward-distributors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import deployPoolLens from '@venusprotocol/isolated-pools/dist/deploy/010-deploy-reward-distributors';

deployPoolLens.skip = async () => process.env.PACKAGE !== 'isolated-pools';

export default deployPoolLens;
5 changes: 5 additions & 0 deletions deploy/011-initial-liquidity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import upgradeComptroller from '@venusprotocol/isolated-pools/dist/deploy/011-initial-liquidity';

upgradeComptroller.skip = async () => process.env.PACKAGE !== 'isolated-pools';

export default upgradeComptroller;
5 changes: 5 additions & 0 deletions deploy/012-transfer-pools-ownership.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import upgradeComptroller from '@venusprotocol/isolated-pools/dist/deploy/012-transfer-pools-ownership';

upgradeComptroller.skip = async () => process.env.PACKAGE !== 'isolated-pools';

export default upgradeComptroller;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import upgradeComptroller from '@venusprotocol/isolated-pools/deploy/011-upgrade-comptroller';
import upgradeComptroller from '@venusprotocol/isolated-pools/dist/deploy/013-vip-based-config';

upgradeComptroller.skip = async () => process.env.PACKAGE !== 'isolated-pools';

Expand Down
5 changes: 5 additions & 0 deletions deploy/014-riskfund-protocolshare.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import upgradeComptroller from '@venusprotocol/isolated-pools/dist/deploy/014-riskfund-protocolshare';

upgradeComptroller.skip = async () => process.env.PACKAGE !== 'isolated-pools';

export default upgradeComptroller;
5 changes: 5 additions & 0 deletions deploy/015-transfer-funds-ownership.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import upgradeComptroller from '@venusprotocol/isolated-pools/dist/deploy/015-transfer-funds-ownership';

upgradeComptroller.skip = async () => process.env.PACKAGE !== 'isolated-pools';

export default upgradeComptroller;
File renamed without changes.
6 changes: 6 additions & 0 deletions mocks/AccessControlManager.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@venusprotocol/governance-contracts/contracts/Governance/AccessControlManager.sol";

contract AccessControlManagerScenario is AccessControlManager {}
20 changes: 20 additions & 0 deletions mocks/BEP20Harness.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract BEP20Harness is ERC20 {
uint8 public decimalsInternal = 18;

constructor(string memory name_, string memory symbol_, uint8 decimals_) ERC20(name_, symbol_) {
decimalsInternal = decimals_;
}

function faucet(uint256 amount) external {
_mint(msg.sender, amount);
}

function decimals() public view virtual override returns (uint8) {
return decimalsInternal;
}
}
20 changes: 0 additions & 20 deletions mocks/MockPriceOracleUnderlyingPrice.sol

This file was deleted.

26 changes: 26 additions & 0 deletions mocks/MockToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MockToken is ERC20 {
uint8 private immutable _decimals;

constructor(
string memory name_,
string memory symbol_,
uint8 decimals_
) ERC20(name_, symbol_) {
_decimals = decimals_;
}

function faucet(uint256 amount) external {
_mint(msg.sender, amount);
}

function decimals() public view virtual override returns (uint8) {
return _decimals;
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@venusprotocol/governance-contracts": "^1.0.0",
"@venusprotocol/isolated-pools": "1.0.0",
"@venusprotocol/oracle": "^1.4.1",
"@venusprotocol/isolated-pools": "2.0.0",
"@venusprotocol/oracle": "^1.7.2",
"@venusprotocol/venus-protocol": "^0.6.0",
"assemblyscript": "0.19.23",
"chai": "^4.3.6",
Expand Down
Loading

0 comments on commit 7f4edaa

Please sign in to comment.