Skip to content

Commit

Permalink
fix: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 committed Jul 16, 2024
1 parent 2b38132 commit 5d69ca4
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions contracts/src/contracts/mailbox.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,21 @@ pub mod mailbox {
let hook_metadata = match _custom_hook_metadata {
Option::Some(hook_metadata) => {
let mut sanitized_bytes_metadata = BytesTrait::new_empty();
sanitized_bytes_metadata.concat(@hook_metadata);
assert(sanitized_bytes_metadata ==hook_metadata, Errors::SIZE_DOES_NOT_MATCH_METADATA);
hook_metadata},
sanitized_bytes_metadata.concat(@hook_metadata);
assert(
sanitized_bytes_metadata == hook_metadata,
Errors::SIZE_DOES_NOT_MATCH_METADATA
);
hook_metadata
},
Option::None(()) => BytesTrait::new_empty()
};
let mut sanitized_bytes_message_body = BytesTrait::new_empty();
sanitized_bytes_message_body.concat(@_message_body);
assert(sanitized_bytes_message_body == _message_body, Errors::SIZE_DOES_NOT_MATCH_MESSAGE_BODY);
assert(
sanitized_bytes_message_body == _message_body,
Errors::SIZE_DOES_NOT_MATCH_MESSAGE_BODY
);
let (id, message) = build_message(
@self, _destination_domain, _recipient_address, _message_body
);
Expand Down Expand Up @@ -344,14 +351,15 @@ pub mod mailbox {
/// * `_metadata` - Metadata used by the ISM to verify `_message`.
/// * `_message` - Formatted Hyperlane message (ref: message.cairo)
fn process(ref self: ContractState, _metadata: Bytes, _message: Message) {


let mut sanitized_bytes_metadata = BytesTrait::new_empty();
sanitized_bytes_metadata.concat(@_metadata);
assert(sanitized_bytes_metadata ==_metadata, Errors::SIZE_DOES_NOT_MATCH_METADATA);
sanitized_bytes_metadata.concat(@_metadata);
assert(sanitized_bytes_metadata == _metadata, Errors::SIZE_DOES_NOT_MATCH_METADATA);
let mut sanitized_bytes_message_body = BytesTrait::new_empty();
sanitized_bytes_message_body.concat(@_message.body);
assert(sanitized_bytes_message_body == _message.body, Errors::SIZE_DOES_NOT_MATCH_MESSAGE_BODY);
assert(
sanitized_bytes_message_body == _message.body,
Errors::SIZE_DOES_NOT_MATCH_MESSAGE_BODY
);

assert(_message.version == HYPERLANE_VERSION, Errors::WRONG_HYPERLANE_VERSION);
assert(
Expand Down

0 comments on commit 5d69ca4

Please sign in to comment.