Skip to content

Commit

Permalink
Update deployCode paths and package.json version
Browse files Browse the repository at this point in the history
Refactored the paths used in the `deployCode` method across test files to use the new directory structure for solidity JSON files. Also, increased the package version in package.json, and updated script orders to include a build step before test and snapshot-related operations.
  • Loading branch information
shuhuiluo authored and gnarlycow committed Apr 5, 2024
1 parent f806020 commit e8f88d8
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 112 deletions.
248 changes: 152 additions & 96 deletions .gas-snapshot

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aperture_finance/uni-v3-lib",
"description": "A suite of Solidity libraries that have been imported and rewritten from Uniswap's v3-core and v3-periphery",
"version": "2.0.1",
"version": "2.0.2",
"author": "Aperture Finance",
"homepage": "https://aperture.finance/",
"license": "GPL-2.0-or-later",
Expand All @@ -25,11 +25,11 @@
"scripts": {
"build": "forge build",
"clean": "forge clean",
"test": "forge test",
"snapshot": "forge snapshot --via-ir --evm-version cancun --isolate",
"snapshot:diff": "forge snapshot --diff --via-ir --evm-version cancun --isolate",
"prettier": "prettier -c {src,test}/**/*.sol",
"prettier:fix": "prettier -w {src,test}/**/*.sol"
"test": "forge build && forge test",
"snapshot": "forge build && forge snapshot --via-ir --evm-version cancun --isolate",
"snapshot:diff": "forge build && forge snapshot --diff --via-ir --evm-version cancun --isolate",
"prettier": "prettier -c src/*.sol {src,test}/**/*.sol",
"prettier:fix": "prettier -w src/*.sol {src,test}/**/*.sol"
},
"dependencies": {
"@openzeppelin/contracts": "^5.0.2",
Expand Down
2 changes: 1 addition & 1 deletion test/BitMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract BitMathTest is Test {
BitMathWrapper internal wrapper;

function setUp() public {
ogWrapper = IBitMath(deployCode("BitMathTest.sol"));
ogWrapper = IBitMath(deployCode("out/BitMathTest.sol/BitMathTest.json"));
wrapper = new BitMathWrapper();
}

Expand Down
2 changes: 1 addition & 1 deletion test/FullMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract FullMathTest is Test {
IFullMath internal wrapper;

function setUp() public {
wrapper = IFullMath(deployCode("FullMathTest.sol"));
wrapper = IFullMath(deployCode("out/FullMathTest.sol/FullMathTest.json"));
}

/// @dev Helper function to assume that the `mulDiv` will not overflow.
Expand Down
2 changes: 1 addition & 1 deletion test/LiquidityAmounts.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ contract LiquidityAmountsTest is BaseTest {
LiquidityAmountsWrapper internal wrapper;

function setUp() public override {
ogWrapper = ILiquidityAmounts(deployCode("LiquidityAmountsTest.sol"));
ogWrapper = ILiquidityAmounts(deployCode("out/LiquidityAmountsTest.sol/LiquidityAmountsTest.json"));
wrapper = new LiquidityAmountsWrapper();
}

Expand Down
2 changes: 1 addition & 1 deletion test/LiquidityMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract LiquidityMathTest is Test {
LiquidityMathWrapper internal wrapper;

function setUp() public {
ogWrapper = ILiquidityMath(deployCode("LiquidityMathTest.sol"));
ogWrapper = ILiquidityMath(deployCode("out/LiquidityMathTest.sol/LiquidityMathTest.json"));
wrapper = new LiquidityMathWrapper();
}

Expand Down
4 changes: 2 additions & 2 deletions test/PoolAddress.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ contract PoolAddressTest is BaseTest {

function setUp() public virtual override {
factory = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
ogWrapper = IPoolAddress(deployCode("PoolAddressTest.sol"));
ogWrapper = IPoolAddress(deployCode("out/PoolAddressTest.sol/PoolAddressTest.json"));
wrapper = new PoolAddressWrapper();
}

Expand Down Expand Up @@ -190,7 +190,7 @@ contract PoolAddressPCSTest is PoolAddressTest {
function setUp() public override {
// This is the PancakeSwap V3 *deployer* contract address as this is used instead of the factory in pool address computation.
factory = 0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9;
ogWrapper = IPoolAddress(deployCode("PoolAddressPancakeSwapV3Test.sol"));
ogWrapper = IPoolAddress(deployCode("out/PoolAddressPancakeSwapV3Test.sol/PoolAddressPancakeSwapV3Test.json"));
wrapper = new PoolAddressPancakeSwapV3Wrapper();
}
}
2 changes: 1 addition & 1 deletion test/SqrtPriceMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ contract SqrtPriceMathTest is BaseTest {
SqrtPriceMathWrapper internal wrapper;

function setUp() public override {
ogWrapper = ISqrtPriceMath(deployCode("SqrtPriceMathTest.sol"));
ogWrapper = ISqrtPriceMath(deployCode("out/SqrtPriceMathTest.sol/SqrtPriceMathTest.json"));
wrapper = new SqrtPriceMathWrapper();
}

Expand Down
2 changes: 1 addition & 1 deletion test/SwapMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract SwapMathTest is BaseTest {
SwapMathWrapper internal wrapper;

function setUp() public override {
ogWrapper = ISwapMath(deployCode("SwapMathTest.sol"));
ogWrapper = ISwapMath(deployCode("out/SwapMathTest.sol/SwapMathTest.json"));
wrapper = new SwapMathWrapper();
}

Expand Down
2 changes: 1 addition & 1 deletion test/TickBitmap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ contract TickBitmapTest is BaseTest {
TickBitmapWrapper internal wrapper;

function setUp() public virtual override {
ogWrapper = ITickBitmap(deployCode("TickBitmapTest.sol"));
ogWrapper = ITickBitmap(deployCode("out/TickBitmapTest.sol/TickBitmapTest.json"));
wrapper = new TickBitmapWrapper();
}

Expand Down
2 changes: 1 addition & 1 deletion test/TickMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract TickMathTest is Test {
TickMathWrapper internal wrapper;

function setUp() public {
ogWrapper = ITickMath(deployCode("TickMathTest.sol"));
ogWrapper = ITickMath(deployCode("out/TickMathTest.sol/TickMathTest.json"));
wrapper = new TickMathWrapper();
}

Expand Down

0 comments on commit e8f88d8

Please sign in to comment.