From 5d69ca453e4ddb6d179d0bedf1c2f031accfc7d1 Mon Sep 17 00:00:00 2001 From: JordyRo1 Date: Tue, 16 Jul 2024 18:28:35 +0200 Subject: [PATCH] fix: format code --- contracts/src/contracts/mailbox.cairo | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/contracts/src/contracts/mailbox.cairo b/contracts/src/contracts/mailbox.cairo index 037a7d8..83b6f8d 100644 --- a/contracts/src/contracts/mailbox.cairo +++ b/contracts/src/contracts/mailbox.cairo @@ -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 ); @@ -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(