Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Sep 4, 2024
1 parent c8a15e5 commit 845fe5a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@ jobs:
node-version: '20'
- run: npm ci
- run: npm run lint
- run: npx hardhat node &
- run: npx hardhat node --fork ${{ secrets.ETH_RPC }} &
- run: npm test
env:
ETH_RPC: ${{ secrets.ETH_RPC }}
OPTIMISM_RPC: ${{ secrets.OPTIMISM_RPC }}
XDAI_RPC: ${{ secrets.XDAI_RPC }}
POLYGON_RPC: ${{ secrets.POLYGON_RPC }}
FANTOM_RPC: ${{ secrets.FANTOM_RPC }}
MOONBEAM_RPC: ${{ secrets.MOONBEAM_RPC }}
KAVA_RPC: ${{ secrets.KAVA_RPC }}
ARBITRUM_RPC: ${{ secrets.ARBITRUM_RPC }}
CELO_RPC: ${{ secrets.CELO_RPC }}
AVALANCHE_RPC: ${{ secrets.AVALANCHE_RPC }}
AURORA_RPC: ${{ secrets.AURORA_RPC }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ dist/**/*
lib/**/*
pnpm-lock.yaml
yarn.lock
test/temp.test.ts

# Hardhat files
/cache
3 changes: 0 additions & 3 deletions hardhat.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import "@nomicfoundation/hardhat-ethers";

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
networks: {
hardhat: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"type": "module",
"devDependencies": {
"@babel/eslint-parser": "^7.25.1",
"@nomicfoundation/hardhat-ethers": "^3.0.8",
"@types/chai": "^4.3.18",
"@types/memoizee": "^0.4.11",
"@types/mocha": "^10.0.7",
Expand Down
4 changes: 2 additions & 2 deletions test/router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const routerSwapTest = async (coin1: string, coin2: string) => {
const { route, output } = await curve.router.getBestRouteAndOutput(coin1, coin2, amount);
assert.isTrue(route.length > 0);
const required = await curve.router.required(coin1, coin2, output);
await stealTokens(coin1, `0x${Math.pow(10, 12)}`);
await stealTokens(coin1, `0x1${'0'.repeat(22)}`);

console.log(route.map((step) => `${step.poolId} (${step.swapParams})`).join(' --> '))
console.log(route);
Expand Down Expand Up @@ -130,7 +130,7 @@ async function stealTokens(coinName: string, amount: string) {
const contract = _curve.contracts[coinAddress].contract;
const cleanup = mockProperty(_curve.signer as JsonRpcSigner, 'address', richAddress);
try {
await _curve.provider.send("hardhat_setBalance", [richAddress, `0x${Math.pow(10, 12)}`]);
await _curve.provider.send("hardhat_setBalance", [richAddress, `0x1$${'0'.repeat(12)}`]);
await _curve.provider.send("hardhat_impersonateAccount", [richAddress]);

console.log(`Stealing ${amount} ${coinName} from ${richAddress}. It has ${richAccount.rawBalance}.`);
Expand Down

0 comments on commit 845fe5a

Please sign in to comment.