Skip to content

Commit

Permalink
Merge pull request #1 from FastLane-Labs/fix-test
Browse files Browse the repository at this point in the history
fix: declare `path` and `solverOps` arrays in test
  • Loading branch information
BenSparksCode authored Sep 27, 2024
2 parents 793036d + 7ef9edd commit 2997e96
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
jobs:
check:
strategy:
fail-fast: true
fail-fast: false

name: Foundry project
runs-on: ubuntu-latest
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
version: nightly-0d8302880b79fa9c3c4aa52ab446583dece19a34 # 2024-08-29 release

- name: Show Forge version
run: |
Expand All @@ -36,10 +36,12 @@ jobs:

- name: Run Forge build
run: |
forge build --sizes
forge build
id: build

- name: Run Forge tests
run: |
forge test -vvv
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
id: test
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
[profile.ci]
fuzz = { runs = 10_000 }
verbosity = 2
ignore_warnings = true

[fmt]
bracket_spacing = true
Expand Down
1 change: 0 additions & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
forge-std/=lib/forge-std/src/
@atlas/=lib/atlas/src/contracts/
@atlas-test/=lib/atlas/test/
openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/
openzeppelin-contracts/=lib/openzeppelin-contracts/
solady/=lib/solady/src/
2 changes: 1 addition & 1 deletion src/UniswapV2DAppControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { UserOperation } from "@atlas/types/UserOperation.sol";
import { SolverOperation } from "@atlas/types/SolverOperation.sol";

// Uniswap Imports
import { IUniswapV2Router01, IUniswapV2Router02 } from "src/interfaces/IUniswapV2Router.sol";
import { IUniswapV2Router01, IUniswapV2Router02 } from "./interfaces/IUniswapV2Router.sol";

/*
* @title UniswapV2DAppControl
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions test/UniswapV2DAppControl.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { BaseTest } from "@atlas-test/base/BaseTest.t.sol";
import { AccountingMath } from "@atlas/libraries/AccountingMath.sol";

// Import the contract under test and related Uniswap V2 router interfaces
import { UniswapV2DAppControl } from "src/UniswapV2DAppControl.sol";
import { IUniswapV2Router01, IUniswapV2Router02 } from "src/interfaces/IUniswapV2Router.sol";
import { UniswapV2DAppControl } from "../src/UniswapV2DAppControl.sol";
import { IUniswapV2Router01, IUniswapV2Router02 } from "../src/interfaces/IUniswapV2Router.sol";

// Import helper contracts for building transactions during testing
import { TxBuilder } from "@atlas/helpers/TxBuilder.sol";
Expand Down Expand Up @@ -77,7 +77,7 @@ contract UniswapV2DAppControlTest is BaseTest {
function test_UniswapV2DAppControl_swapWETHForDAI() public {
// Initialize structures to hold user and solver operations as well as DApp operation details.
UserOperation memory userOp;
SolverOperation;
SolverOperation[] memory solverOps = new SolverOperation[](1);
DAppOperation memory dAppOp;

// ===========================
Expand All @@ -98,7 +98,7 @@ contract UniswapV2DAppControlTest is BaseTest {
vm.label(address(executionEnvironment), "EXECUTION ENV");

// Define the token swap path for Uniswap V2: from WETH to DAI.
address;
address[] memory path = new address[](2);
path[0] = WETH_ADDRESS; // Starting token: Wrapped ETH
path[1] = DAI_ADDRESS; // Target token: DAI

Expand Down

0 comments on commit 2997e96

Please sign in to comment.