The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/solidity/optics-core/contracts/test/TestMessage.sol

43 lines
1.1 KiB

// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
import "../Common.sol";
contract TestMessage {
using Message for bytes29;
using TypedMemView for bytes;
using TypedMemView for bytes29;
function body(bytes memory _message) external view returns (bytes memory) {
return _message.ref(0).body().clone();
}
function origin(bytes memory _message) external pure returns (uint32) {
return _message.ref(0).origin();
}
function sender(bytes memory _message) external pure returns (bytes32) {
return _message.ref(0).sender();
}
function sequence(bytes memory _message) external pure returns (uint32) {
return _message.ref(0).sequence();
}
function destination(bytes memory _message) external pure returns (uint32) {
return _message.ref(0).destination();
}
function recipient(bytes memory _message) external pure returns (bytes32) {
return _message.ref(0).recipient();
}
function recipientAddress(bytes memory _message)
external
pure
returns (address)
{
return _message.ref(0).recipientAddress();
}
}