Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Oct 11, 2024
1 parent 9d9f74d commit 053cc6a
Show file tree
Hide file tree
Showing 42 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/Revert.sol/interface.Revertable.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Revertable
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/Revert.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/Revert.sol)

Interface for contracts that support revertable calls.

Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/Revert.sol/struct.RevertContext.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RevertContext
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/Revert.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/Revert.sol)

Struct containing revert context passed to onRevert.

Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/Revert.sol/struct.RevertOptions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RevertOptions
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/Revert.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/Revert.sol)

Struct containing revert options

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ERC20Custody
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/ERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/ERC20Custody.sol)

**Inherits:**
[IERC20Custody](/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20Custody.md), ReentrancyGuard, AccessControl, Pausable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GatewayEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/GatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/GatewayEVM.sol)

**Inherits:**
Initializable, AccessControlUpgradeable, UUPSUpgradeable, [IGatewayEVM](/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVM.md), ReentrancyGuardUpgradeable, PausableUpgradeable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZetaConnectorBase
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/ZetaConnectorBase.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/ZetaConnectorBase.sol)

**Inherits:**
[IZetaConnectorEvents](/contracts/evm/interfaces/IZetaConnector.sol/interface.IZetaConnectorEvents.md), ReentrancyGuard, Pausable, AccessControl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZetaConnectorNative
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/ZetaConnectorNative.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/ZetaConnectorNative.sol)

**Inherits:**
[ZetaConnectorBase](/contracts/evm/ZetaConnectorBase.sol/abstract.ZetaConnectorBase.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZetaConnectorNonNative
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/ZetaConnectorNonNative.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/ZetaConnectorNonNative.sol)

**Inherits:**
[ZetaConnectorBase](/contracts/evm/ZetaConnectorBase.sol/abstract.ZetaConnectorBase.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20Custody
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IERC20Custody.sol)

**Inherits:**
[IERC20CustodyEvents](/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyEvents.md), [IERC20CustodyErrors](/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyErrors.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20CustodyErrors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IERC20Custody.sol)

Interface for the errors used in the ERC20 custody contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20CustodyEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IERC20Custody.sol)

Interface for the events emitted by the ERC20 custody contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Callable
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IGatewayEVM.sol)

Interface implemented by contracts receiving authenticated calls.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IGatewayEVM.sol)

**Inherits:**
[IGatewayEVMErrors](/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMErrors.md), [IGatewayEVMEvents](/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMEvents.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayEVMErrors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IGatewayEVM.sol)

Interface for the errors used in the GatewayEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayEVMEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IGatewayEVM.sol)

Interface for the events emitted by the GatewayEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MessageContext
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IGatewayEVM.sol)

Message context passed to execute function.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZetaConnectorEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IZetaConnector.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IZetaConnector.sol)

Interface for the events emitted by the ZetaConnector contracts.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZetaNonEthNew
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/evm/interfaces/IZetaNonEthNew.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/evm/interfaces/IZetaNonEthNew.sol)

**Inherits:**
IERC20
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GatewayZEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/GatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/GatewayZEVM.sol)

**Inherits:**
[IGatewayZEVM](/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVM.md), Initializable, AccessControlUpgradeable, UUPSUpgradeable, ReentrancyGuardUpgradeable, PausableUpgradeable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SystemContract
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/SystemContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/SystemContract.sol)

**Inherits:**
[SystemContractErrors](/contracts/zevm/SystemContract.sol/interface.SystemContractErrors.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SystemContractErrors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/SystemContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/SystemContract.sol)

*Custom errors for SystemContract*

Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/zevm/ZRC20.sol/contract.ZRC20.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZRC20
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/ZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/ZRC20.sol)

**Inherits:**
[IZRC20Metadata](/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20Metadata.md), [ZRC20Errors](/contracts/zevm/ZRC20.sol/interface.ZRC20Errors.md), [ZRC20Events](/contracts/zevm/interfaces/IZRC20.sol/interface.ZRC20Events.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZRC20Errors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/ZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/ZRC20.sol)

*Custom errors for ZRC20*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayZEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IGatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IGatewayZEVM.sol)

**Inherits:**
[IGatewayZEVMErrors](/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMErrors.md), [IGatewayZEVMEvents](/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMEvents.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayZEVMErrors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IGatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IGatewayZEVM.sol)

Interface for the errors used in the GatewayZEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayZEVMEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IGatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IGatewayZEVM.sol)

Interface for the events emitted by the GatewayZEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CallOptions
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IGatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IGatewayZEVM.sol)

CallOptions struct passed to call and withdrawAndCall functions.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ISystem
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/ISystem.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/ISystem.sol)

Interface for the System contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IWETH9
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IWZETA.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IWZETA.sol)

Interface for the Weth9 contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CoinType
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IZRC20.sol)

*Coin types for ZRC20. Zeta value should not be used.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZRC20
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IZRC20.sol)

Interface for the ZRC20 token contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZRC20Metadata
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IZRC20.sol)

**Inherits:**
[IZRC20](/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZRC20Events
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/IZRC20.sol)

Interface for the ZRC20 events.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# UniversalContract
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/UniversalContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/UniversalContract.sol)


## Functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zContract
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/UniversalContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/UniversalContract.sol)


## Functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zContext
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/57d1446373e344f7366de3008e0bf2b97aeeabf8/contracts/zevm/interfaces/UniversalContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/9d9f74dd2aed9f09a6d76a6c496c5bc1db204e89/contracts/zevm/interfaces/UniversalContract.sol)


```solidity
Expand Down
2 changes: 1 addition & 1 deletion v2/pkg/gatewayevm.t.sol/gatewayevminboundtest.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/gatewayevm.t.sol/gatewayevmtest.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/gatewayzevm.t.sol/gatewayzevminboundtest.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/pkg/gatewayzevm.t.sol/gatewayzevmoutboundtest.go

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions v2/test/GatewayEVM.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ contract GatewayEVMInboundTest is Test, IGatewayEVMErrors, IGatewayEVMEvents, IR
function testDepositERC20ToCustodyFailsIfPayloadSizeExceeded() public {
uint256 amount = 100_000;
token.approve(address(gateway), amount);
revertOptions.revertMessage = new bytes(1025);
revertOptions.revertMessage = new bytes(gateway.MAX_PAYLOAD_SIZE() + 1);

vm.expectRevert(PayloadSizeExceeded.selector);
gateway.deposit(destination, amount, address(token), revertOptions);
Expand Down Expand Up @@ -497,7 +497,7 @@ contract GatewayEVMInboundTest is Test, IGatewayEVMErrors, IGatewayEVMEvents, IR
}

function testFailDepositEthToTssIfPayloadSizeExceeded() public {
revertOptions.revertMessage = new bytes(1025);
revertOptions.revertMessage = new bytes(gateway.MAX_PAYLOAD_SIZE() + 1);
vm.expectRevert("PayloadSizeExceeded");
gateway.deposit{ value: 1 }(destination, revertOptions);
}
Expand All @@ -524,8 +524,8 @@ contract GatewayEVMInboundTest is Test, IGatewayEVMErrors, IGatewayEVMEvents, IR

function testDepositERC20ToCustodyWithPayloadFailsIfPayloadSizeExceeded() public {
uint256 amount = 100_000;
bytes memory payload = new bytes(512);
revertOptions.revertMessage = new bytes(513);
bytes memory payload = new bytes(gateway.MAX_PAYLOAD_SIZE() / 2);
revertOptions.revertMessage = new bytes(gateway.MAX_PAYLOAD_SIZE() / 2 + 1);

token.approve(address(gateway), amount);

Expand Down Expand Up @@ -586,8 +586,8 @@ contract GatewayEVMInboundTest is Test, IGatewayEVMErrors, IGatewayEVMEvents, IR

function testDepositEthToTssWithPayloadFailsIfPayloadSizeExceeded() public {
uint256 amount = 100_000;
bytes memory payload = new bytes(512);
revertOptions.revertMessage = new bytes(513);
bytes memory payload = new bytes(gateway.MAX_PAYLOAD_SIZE() / 2);
revertOptions.revertMessage = new bytes(gateway.MAX_PAYLOAD_SIZE() / 2 + 1);

vm.expectRevert(PayloadSizeExceeded.selector);
gateway.depositAndCall{ value: amount }(destination, payload, revertOptions);
Expand Down Expand Up @@ -618,8 +618,8 @@ contract GatewayEVMInboundTest is Test, IGatewayEVMErrors, IGatewayEVMEvents, IR
}

function testCallWithPayloadFailsIfPayloadSizeExceeded() public {
bytes memory payload = new bytes(512);
revertOptions.revertMessage = new bytes(513);
bytes memory payload = new bytes(gateway.MAX_PAYLOAD_SIZE() / 2);
revertOptions.revertMessage = new bytes(gateway.MAX_PAYLOAD_SIZE() / 2 + 1);

vm.expectRevert(PayloadSizeExceeded.selector);
gateway.call(destination, payload, revertOptions);
Expand Down
Loading

0 comments on commit 053cc6a

Please sign in to comment.