Skip to content

Commit

Permalink
✅ add deployment tests for address 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Oct 16, 2024
1 parent 604e758 commit a4995ce
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion test/Deployment.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,45 @@ contract DeploymentTest is Test, Setup {
}
}

//@custom:todo add zero address missing tests
function test_deploy_zap_zero_address() public {
try setup.deploySystem({
perpsMarketProxy: perpsMarketProxy,
spotMarketProxy: spotMarketProxy,
sUSDProxy: sUSDProxy,
pDAO: pDAO,
zap: address(0),
usdc: usdc,
weth: weth
}) {} catch (bytes memory reason) {
assertEq(bytes4(reason), IEngine.ZeroAddress.selector);
}
}

function test_deploy_usdc_zero_address() public {
try setup.deploySystem({
perpsMarketProxy: perpsMarketProxy,
spotMarketProxy: spotMarketProxy,
sUSDProxy: sUSDProxy,
pDAO: pDAO,
zap: zap,
usdc: address(0),
weth: weth
}) {} catch (bytes memory reason) {
assertEq(bytes4(reason), IEngine.ZeroAddress.selector);
}
}

function test_deploy_weth_zero_address() public {
try setup.deploySystem({
perpsMarketProxy: perpsMarketProxy,
spotMarketProxy: spotMarketProxy,
sUSDProxy: sUSDProxy,
pDAO: pDAO,
zap: zap,
usdc: usdc,
weth: address(0)
}) {} catch (bytes memory reason) {
assertEq(bytes4(reason), IEngine.ZeroAddress.selector);
}
}
}

0 comments on commit a4995ce

Please sign in to comment.