Skip to content

Commit

Permalink
test: migrate type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aquariuslt committed May 21, 2024
1 parent f46cbe8 commit 4b84737
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/integration/03-buy/Buy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ contract Buy is BaseIntegrationTest {

for (uint32 i = 0; i < 10; i++) {
// flat _buyShare function to avoid stack too deep error
uint256 quantity = 1;
uint32 quantity = 1;
(uint256 buyPriceAfterFee,,,) = sharesFactory.getBuyPriceAfterFee(shareId, quantity, FACTORY_OWNER);
// balance of POORMAN only can buy 1 nft
if (i >= 1) {
Expand Down Expand Up @@ -76,7 +76,7 @@ contract Buy is BaseIntegrationTest {
vm.deal(POORMAN, POORMAN_LIMITED);
vm.startPrank(POORMAN);

uint256 quantity = 1;
uint32 quantity = 1;
(uint256 buyPriceAfterFee,,,) = sharesFactory.getBuyPriceAfterFee(shareId, quantity, FACTORY_OWNER);
vm.expectRevert();
sharesFactory.buyShare{ value: buyPriceAfterFee }(shareId, quantity, FACTORY_OWNER);
Expand Down
2 changes: 1 addition & 1 deletion test/integration/04-sell/Sell.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract Sell is BaseIntegrationTest {

// it should be revert if no share is minted
uint256 shareId = 1;
uint256 quantity = 1;
uint32 quantity = 1;

vm.prank(DAILY_TRADER);
vm.expectRevert("Invalid shareId");
Expand Down
6 changes: 3 additions & 3 deletions test/integration/BaseIntegrationTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract BaseIntegrationTest is Test {
address public LONG_TERM_TRADER = address(6);

struct PresetCurveParams {
uint128 basePrice;
uint96 basePrice;
uint32 inflectionPoint;
uint128 inflectionPrice;
uint128 linearPriceSlope;
Expand Down Expand Up @@ -145,7 +145,7 @@ contract BaseIntegrationTest is Test {
// common initial contract with specific args
// @dev call after deployContracts and if needed

function _buyShare(address sender, uint256 shareId, uint256 quantity, address referral) internal {
function _buyShare(address sender, uint256 shareId, uint32 quantity, address referral) internal {
(uint256 buyPriceAfterFee,,,) = sharesFactory.getBuyPriceAfterFee(shareId, quantity, referral);

vm.prank(address(sender));
Expand All @@ -161,7 +161,7 @@ contract BaseIntegrationTest is Test {
);
}

function _sellShare(address sender, uint256 shareId, uint256 quantity, address referral) internal {
function _sellShare(address sender, uint256 shareId, uint32 quantity, address referral) internal {
(uint256 sellPriceAfterFee,,,) = sharesFactory.getSellPriceAfterFee(shareId, quantity, referral);

vm.prank(address(sender));
Expand Down
2 changes: 1 addition & 1 deletion test/integration/BaseInvariantTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract BaseInvariantTest is StdInvariant {
string public constant BASE_URI = "https://foo.com/shares/uri/";

struct PresetCurveParams {
uint128 basePrice;
uint96 basePrice;
uint32 inflectionPoint;
uint128 inflectionPrice;
uint128 linearPriceSlope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ contract BoundedIntegrationContextHandler is StdUtils {

function setCurveType(
uint8 _curveType,
uint256 _basePrice,
uint256 _inflectionPoint,
uint256 _inflectionPrice,
uint256 _linearPriceSlope
uint96 _basePrice,
uint32 _inflectionPoint,
uint128 _inflectionPrice,
uint128 _linearPriceSlope
) public {
numCalls["boundedIntContext.setCurveType"]++;

Expand Down

0 comments on commit 4b84737

Please sign in to comment.