Skip to content

Commit

Permalink
chore(contracts): made processInboundMessage payable to mock send val…
Browse files Browse the repository at this point in the history
…ue 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
  • Loading branch information
aroralanuk authored Nov 5, 2024
1 parent c064881 commit a82b4b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-drinks-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/core': minor
---

Made processInboundMessage payable to send value via mailbox.process
3 changes: 2 additions & 1 deletion solidity/contracts/Mailbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -56,6 +56,7 @@ contract Mailbox is
address processor;
uint48 blockNumber;
}

mapping(bytes32 => Delivery) internal deliveries;

// ============ Events ============
Expand Down
4 changes: 2 additions & 2 deletions solidity/contracts/mock/MockMailbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit a82b4b4

Please sign in to comment.