Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved message bus documentation, using explicit inboxMessageStatus… #709

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions contracts/lib/MessageBus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ library MessageBus {
* messageBox inbox.
* @param _messageBoxOffset Position of the messageBox.
* @param _storageRoot Storage root for proof.
* @param _messageStatus Message status of message hash in the inbox on
* @param _inboxMessageStatus Message status of message hash in the inbox on
* target chain.
*
* @return messageHash_ Message hash.
Expand All @@ -253,7 +253,7 @@ library MessageBus {
bytes calldata _rlpParentNodes,
uint8 _messageBoxOffset,
bytes32 _storageRoot,
MessageStatus _messageStatus
MessageStatus _inboxMessageStatus
)
external
returns (bytes32 messageHash_)
Expand All @@ -267,8 +267,8 @@ library MessageBus {
* `Progressed` when outbox message status at source is `Declared`.
*/
require(
_messageStatus == MessageStatus.Declared ||
_messageStatus == MessageStatus.Progressed,
_inboxMessageStatus == MessageStatus.Declared ||
_inboxMessageStatus == MessageStatus.Progressed,
"Message on target must be Declared or Progressed."
);

Expand All @@ -279,7 +279,7 @@ library MessageBus {
* when outbox message status at source is `DeclaredRevocation`.
*/
require(
_messageStatus == MessageStatus.Progressed,
_inboxMessageStatus == MessageStatus.Progressed,
"Message on target must be Progressed."
);

Expand All @@ -298,7 +298,7 @@ library MessageBus {
// Verify the merkle proof.
require(
MerklePatriciaProof.verify(
keccak256(abi.encodePacked(_messageStatus)),
keccak256(abi.encodePacked(_inboxMessageStatus)),
storagePath,
_rlpParentNodes,
_storageRoot),
Expand Down Expand Up @@ -356,7 +356,7 @@ library MessageBus {
* messageBox outbox.
* @param _messageBoxOffset Position of the messageBox.
* @param _storageRoot Storage root for proof.
* @param _messageStatus Message status of message hash in the outbox of
* @param _outboxMessageStatus Message status of message hash in the outbox of
* source chain.
*
* @return messageHash_ Message hash.
Expand All @@ -367,15 +367,15 @@ library MessageBus {
bytes calldata _rlpParentNodes,
uint8 _messageBoxOffset,
bytes32 _storageRoot,
MessageStatus _messageStatus
MessageStatus _outboxMessageStatus
)
external
returns (bytes32 messageHash_)
{
// Outbox message status must be either `Declared` or `Progressed`.
require(
_messageStatus == MessageStatus.Declared ||
_messageStatus == MessageStatus.Progressed,
_outboxMessageStatus == MessageStatus.Declared ||
_outboxMessageStatus == MessageStatus.Progressed,
"Message on source must be Declared or Progressed."
);

Expand All @@ -397,7 +397,7 @@ library MessageBus {
// Perform the merkle proof.
require(
MerklePatriciaProof.verify(
keccak256(abi.encodePacked(_messageStatus)),
keccak256(abi.encodePacked(_outboxMessageStatus)),
path,
_rlpParentNodes,
_storageRoot
Expand Down Expand Up @@ -507,7 +507,7 @@ library MessageBus {
* @param _rlpParentNodes RLP encoded parent node data to prove in
* messageBox inbox.
* @param _storageRoot Storage root for proof.
* @param _messageStatus Message status of message hash in the inbox of
* @param _inboxMessageStatus Message status of message hash in the inbox of
* source chain.
*
* @return messageHash_ Message hash.
Expand All @@ -518,13 +518,13 @@ library MessageBus {
uint8 _messageBoxOffset,
bytes calldata _rlpParentNodes,
bytes32 _storageRoot,
MessageStatus _messageStatus
MessageStatus _inboxMessageStatus
)
external
returns (bytes32 messageHash_)
{
require(
_messageStatus == MessageStatus.Revoked,
_inboxMessageStatus == MessageStatus.Revoked,
"Message on target status must be Revoked."
);

Expand All @@ -547,7 +547,7 @@ library MessageBus {
// Perform the merkle proof.
require(
MerklePatriciaProof.verify(
keccak256(abi.encodePacked(_messageStatus)),
keccak256(abi.encodePacked(_inboxMessageStatus)),
path,
_rlpParentNodes,
_storageRoot
Expand Down