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/core/contracts/test/TestMessage.sol

47 lines
1.4 KiB

// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
import {Message} from "../../libs/Message.sol";
import {TypedMemView} from "@summa-tx/memview-sol/contracts/TypedMemView.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 nonce(bytes memory _message) external pure returns (uint32) {
return _message.ref(0).nonce();
}
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();
}
function leaf(bytes memory _message) external view returns (bytes32) {
return _message.ref(0).leaf();
}
}