Skip to content

Commit

Permalink
Small test var refactor for shared stuff to Base
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSparksCode committed Aug 11, 2023
1 parent b4079ed commit 9f9ae3e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
7 changes: 1 addition & 6 deletions test/MainTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ contract MainTest is BaseTest {
}

function testMain() public {
vm.label(userEOA, "USER");
vm.label(escrow, "ESCROW");
vm.label(address(atlas), "ATLAS");
vm.label(address(control), "PCONTROL");

uint8 v;
bytes32 r;
bytes32 s;
Expand Down Expand Up @@ -75,7 +70,7 @@ contract MainTest is BaseTest {
vm.startPrank(userEOA);

address executionEnvironment = IAtlas(address(atlas)).createExecutionEnvironment(protocolCall);
vm.label(address(executionEnvironment), "ENVIRONMENT");
vm.label(address(executionEnvironment), "EXECUTION ENV");

console.log("userEOA", userEOA);
console.log("atlas", address(atlas));
Expand Down
25 changes: 24 additions & 1 deletion test/SwapIntent.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ import "forge-std/Test.sol";

import {BaseTest} from "./base/BaseTest.t.sol";

import {ProtocolCall} from "../src/contracts/types/CallTypes.sol";

// QUESTIONS:
// 1. What is escrowDuration (constructor arg in Atlas, Escrow.sol)? Where is it used?

// Refactor Ideas:
// 1. Lots of bitwise operations explicitly coded in contracts - could be a helper lib thats more readable


contract SwapIntentTest is BaseTest {

Expand All @@ -17,10 +22,28 @@ contract SwapIntentTest is BaseTest {
}

function testAtlasSwapUsingIntent() public {

// Swap 10 WETH for 20 FXS


uint8 v;
bytes32 r;
bytes32 s;

ProtocolCall memory protocolCall = helper.getProtocolCall();
// UserCall memory userCall = helper.buildUserCall(POOL_ONE, userEOA, TOKEN_ONE);

address executionEnvironment = atlas.createExecutionEnvironment(protocolCall);
vm.label(address(executionEnvironment), "EXECUTION ENV");


console.log("userEOA", userEOA);
console.log("atlas", address(atlas));
console.log("escrow", address(escrow));
console.log("control", address(control));
console.log("executionEnvironment", executionEnvironment);



}

}
5 changes: 5 additions & 0 deletions test/base/BaseTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,10 @@ contract BaseTest is Test, TestConstants {

deal(TOKEN_ZERO, address(atlas), 1);
deal(TOKEN_ONE, address(atlas), 1);

vm.label(userEOA, "USER");
vm.label(escrow, "ESCROW");
vm.label(address(atlas), "ATLAS");
vm.label(address(control), "PROTOCOL CONTROL");
}
}

0 comments on commit 9f9ae3e

Please sign in to comment.