From a82b4b4cbb14bf37be4bd60cc46d7bc0b5e6c316 Mon Sep 17 00:00:00 2001 From: Kunal Arora <55632507+aroralanuk@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:06:16 +0530 Subject: [PATCH] chore(contracts): made processInboundMessage payable to mock send value via mailbox.process (#4797) ### Description processInboundMessage needs to be payable for mocking sending value for ICA router call ### Drive-by changes None ### Related issues None ### Backward compatibility Yes ### Testing None --- .changeset/six-drinks-eat.md | 5 +++++ solidity/contracts/Mailbox.sol | 3 ++- solidity/contracts/mock/MockMailbox.sol | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/six-drinks-eat.md diff --git a/.changeset/six-drinks-eat.md b/.changeset/six-drinks-eat.md new file mode 100644 index 0000000000..8a759677ed --- /dev/null +++ b/.changeset/six-drinks-eat.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/core': minor +--- + +Made processInboundMessage payable to send value via mailbox.process diff --git a/solidity/contracts/Mailbox.sol b/solidity/contracts/Mailbox.sol index 4727076849..a2971d0527 100644 --- a/solidity/contracts/Mailbox.sol +++ b/solidity/contracts/Mailbox.sol @@ -10,7 +10,7 @@ import {IInterchainSecurityModule, ISpecifiesInterchainSecurityModule} from "./i import {IPostDispatchHook} from "./interfaces/hooks/IPostDispatchHook.sol"; import {IMessageRecipient} from "./interfaces/IMessageRecipient.sol"; import {IMailbox} from "./interfaces/IMailbox.sol"; -import {PackageVersioned} from "contracts/PackageVersioned.sol"; +import {PackageVersioned} from "./PackageVersioned.sol"; // ============ External Imports ============ import {Address} from "@openzeppelin/contracts/utils/Address.sol"; @@ -56,6 +56,7 @@ contract Mailbox is address processor; uint48 blockNumber; } + mapping(bytes32 => Delivery) internal deliveries; // ============ Events ============ diff --git a/solidity/contracts/mock/MockMailbox.sol b/solidity/contracts/mock/MockMailbox.sol index c4b4b63e95..25cd4c1cec 100644 --- a/solidity/contracts/mock/MockMailbox.sol +++ b/solidity/contracts/mock/MockMailbox.sol @@ -78,8 +78,8 @@ contract MockMailbox is Mailbox { inboundProcessedNonce++; } - function processInboundMessage(uint32 _nonce) public { + function processInboundMessage(uint32 _nonce) public payable { bytes memory _message = inboundMessages[_nonce]; - Mailbox(address(this)).process("", _message); + Mailbox(address(this)).process{value: msg.value}("", _message); } }