Skip to content

Commit

Permalink
Rollback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
byshape committed Aug 13, 2024
1 parent 00292f7 commit c1afaa2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 34 deletions.
44 changes: 22 additions & 22 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,48 @@ EscrowTest:test_CancelDst() (gas: 116126)
EscrowTest:test_CancelDstDifferentTarget() (gas: 143384)
EscrowTest:test_CancelDstWithNativeToken() (gas: 93710)
EscrowTest:test_CancelPublicSrc() (gas: 165464)
EscrowTest:test_CancelResolverSrc() (gas: 168624)
EscrowTest:test_CancelResolverSrc() (gas: 168607)
EscrowTest:test_CancelResolverSrcReceiver() (gas: 179361)
EscrowTest:test_NoAnyoneCancelDuringResolverCancelSrc() (gas: 163836)
EscrowTest:test_NoAnyoneCancelDuringResolverCancelSrc() (gas: 163856)
EscrowTest:test_NoCallsWithInvalidImmutables() (gas: 286516)
EscrowTest:test_NoCancelByAnyoneDst() (gas: 121726)
EscrowTest:test_NoCancelDuringWithdrawalDst() (gas: 121486)
EscrowTest:test_NoCancelDuringWithdrawalSrc() (gas: 163959)
EscrowTest:test_NoFailedNativeTokenTransferCancelSrc() (gas: 179302)
EscrowTest:test_NoCancelDuringWithdrawalSrc() (gas: 164001)
EscrowTest:test_NoFailedNativeTokenTransferCancelSrc() (gas: 179339)
EscrowTest:test_NoFailedNativeTokenTransferWithdrawalDst() (gas: 154544)
EscrowTest:test_NoFailedNativeTokenTransferWithdrawalSrc() (gas: 312369)
EscrowTest:test_NoFailedNativeTokenTransferWithdrawalSrc() (gas: 312329)
EscrowTest:test_NoPublicCancelDuringPrivateCancellationSrc() (gas: 163146)
EscrowTest:test_NoPublicWithdrawOutsideOfAllowedPeriodDst() (gas: 126910)
EscrowTest:test_NoPublicWithdrawalOutsideOfAllowedPeriodSrc() (gas: 169083)
EscrowTest:test_NoPublicWithdrawalOutsideOfAllowedPeriodSrc() (gas: 169085)
EscrowTest:test_NoRescueFundsByAnyoneDst() (gas: 176370)
EscrowTest:test_NoRescueFundsByAnyoneSrc() (gas: 209064)
EscrowTest:test_NoRescueFundsEarlierDst() (gas: 175780)
EscrowTest:test_NoRescueFundsEarlierSrc() (gas: 208981)
EscrowTest:test_NoRescueFundsEarlierSrc() (gas: 209041)
EscrowTest:test_NoRevertFailedNativeTokenTransferWithdrawalDstNative() (gas: 91111)
EscrowTest:test_NoWithdrawalByAnyoneSrc() (gas: 160853)
EscrowTest:test_NoWithdrawalByAnyoneSrc() (gas: 160873)
EscrowTest:test_NoWithdrawalByNonResolverDst() (gas: 121439)
EscrowTest:test_NoWithdrawalOutsideOfAllowedPeriodDst() (gas: 126326)
EscrowTest:test_NoWithdrawalOutsideOfAllowedPeriodSrc() (gas: 169636)
EscrowTest:test_NoWithdrawalWithWrongSecretDst() (gas: 122776)
EscrowTest:test_NoWithdrawalWithWrongSecretSrc() (gas: 164448)
EscrowTest:test_NoWithdrawalWithWrongSecretSrc() (gas: 164478)
EscrowTest:test_PublicWithdrawSrc() (gas: 181761)
EscrowTest:test_RescueFundsDst() (gas: 158304)
EscrowTest:test_RescueFundsDstNative() (gas: 186735)
EscrowTest:test_RescueFundsSrc() (gas: 195453)
EscrowTest:test_RescueFundsSrcNative() (gas: 197742)
EscrowTest:test_RescueFundsSrc() (gas: 195445)
EscrowTest:test_RescueFundsSrcNative() (gas: 197743)
EscrowTest:test_WithdrawByAnyoneDst() (gas: 141326)
EscrowTest:test_WithdrawByResolverDst() (gas: 142389)
EscrowTest:test_WithdrawByResolverDstNative() (gas: 97831)
EscrowTest:test_WithdrawByResolverPublicDst() (gas: 141757)
EscrowTest:test_WithdrawSrc() (gas: 186522)
EscrowTest:test_WithdrawSrcTo() (gas: 191335)
EscrowTest:test_WithdrawSrc() (gas: 186505)
EscrowTest:test_WithdrawSrcTo() (gas: 191352)
IntegrationEscrowFactoryTest:test_DeployCloneForMakerNonWhitelistedResolverInt() (gas: 473542)
IntegrationEscrowFactoryTest:test_NoInsufficientBalanceDeploymentForMakerInt() (gas: 341264)
IntegrationEscrowFactoryTest:test_NoResolverReentrancy() (gas: 2065184)
IntegrationResolverMockTest:test_MockCancelDst() (gas: 157184)
IntegrationResolverMockTest:test_MockCancelSrc() (gas: 353957)
IntegrationResolverMockTest:test_MockCancelSrc() (gas: 353972)
IntegrationResolverMockTest:test_MockDeployDst() (gas: 151470)
IntegrationResolverMockTest:test_MockDeploySrc() (gas: 365054)
IntegrationResolverMockTest:test_MockDeploySrc() (gas: 364921)
IntegrationResolverMockTest:test_MockPublicCancelSrc() (gas: 392471)
IntegrationResolverMockTest:test_MockPublicWithdrawDst() (gas: 164841)
IntegrationResolverMockTest:test_MockRescueFundsDst() (gas: 161103)
Expand All @@ -60,17 +60,17 @@ IntegrationResolverMockTest:test_MockWithdrawDst() (gas: 182912)
IntegrationResolverMockTest:test_MockWithdrawToSrc() (gas: 354839)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillAllExtra() (gas: 923554)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillAllFromLast() (gas: 922336)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillAllTwoFills() (gas: 922158)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillAllTwoFills() (gas: 922148)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillFirst() (gas: 707638)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillFirstTwoFills() (gas: 932982)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillLast() (gas: 707218)
MerkleStorageInvalidatorIntTest:test_MultipleFillsNoDeploymentWithoutValidation() (gas: 301343)
MerkleStorageInvalidatorIntTest:test_MultipleFillsNoReuseOfSecrets() (gas: 1068017)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillFirstTwoFills() (gas: 932969)
MerkleStorageInvalidatorIntTest:test_MultipleFillsFillLast() (gas: 707297)
MerkleStorageInvalidatorIntTest:test_MultipleFillsNoDeploymentWithoutValidation() (gas: 301456)
MerkleStorageInvalidatorIntTest:test_MultipleFillsNoReuseOfSecrets() (gas: 1069228)
MerkleStorageInvalidatorIntTest:test_MultipleFillsNoSecondDeploymentWithTheSameIndex() (gas: 786011)
MerkleStorageInvalidatorIntTest:test_MultipleFillsOddDivision() (gas: 444783)
MerkleStorageInvalidatorIntTest:test_MultipleFillsOneFill() (gas: 707615)
MerkleStorageInvalidatorIntTest:test_MultipleFillsOneFill() (gas: 707645)
MerkleStorageInvalidatorIntTest:test_MultipleFillsTwoFills() (gas: 921433)
MerkleStorageInvalidatorTest:test_ShortenedProofIsNotValid() (gas: 230552)
MerkleStorageInvalidatorTest:test_ShortenedProofIsNotValid() (gas: 230605)
TimelocksLibTest:test_NoTimelocksOverflow() (gas: 156200)
TimelocksLibTest:test_getStartTimestamps() (gas: 16207)
TimelocksLibTest:test_setDeployedAt() (gas: 5741)
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: FOUNDRY_PROFILE=default forge test -vvv --gas-report

test-zksync:
runs-on: macos-13
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

coverage-zksync:
runs-on: ubuntu-latest
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
Expand Down
10 changes: 1 addition & 9 deletions test/unit/Escrow.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,9 @@ contract EscrowTest is BaseSetup {
swapData.srcClone.publicWithdraw(SECRET, swapData.immutables);
}

function _keccakBytes32(bytes32 secret) private pure returns (bytes32 ret) {
assembly ("memory-safe") {
mstore(0, secret)
ret := keccak256(0, 0x20)
}
}

function test_PublicWithdrawSrc() public {
bytes32 hashlock = _keccakBytes32(SECRET);
// deploy escrow
CrossChainTestLib.SwapData memory swapData = _prepareDataSrcHashlock(hashlock, true, false);
CrossChainTestLib.SwapData memory swapData = _prepareDataSrc(true, false);

(bool success,) = address(swapData.srcClone).call{ value: SRC_SAFETY_DEPOSIT }("");
assertEq(success, true);
Expand Down
2 changes: 1 addition & 1 deletion test/utils/BaseSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Timelocks } from "./libraries/TimelocksSettersLib.sol";
/* solhint-disable max-states-count */
contract BaseSetup is Test, Utils {
/* solhint-disable private-vars-leading-underscore */
bytes32 internal constant SECRET = keccak256(abi.encodePacked(uint256(123)));
bytes32 internal constant SECRET = keccak256(abi.encodePacked("secret"));
bytes32 internal constant HASHED_SECRET = keccak256(abi.encodePacked(SECRET));
uint256 internal constant MAKING_AMOUNT = 0.3 ether;
uint256 internal constant TAKING_AMOUNT = 0.5 ether;
Expand Down

0 comments on commit c1afaa2

Please sign in to comment.